Help: How to get distance with optional specific length?


#1

Hi, I need the ability to get two points that define a distance but also let a user specify a length.
It will be used to extrude a meshface, so the direction is set, so what I need is either for the user to visually do this by dragging the mouse or typing in the distance.

I would in other words need the same functionality as extrude has today (without the direction option etc.).
I have not added options to stuff like this before so what would be the best way?

Thanks!


(Pascal Golay) #2

Hi Jorgen - if you are using GetPoint(), try gp.AcceptNumber().

gp = Rhino.Input.Custom.GetPoint()
gp.AcceptNumber(True, False)

Then in the Get(), look for a number:

    if ret == Rhino.Input.GetResult.Number:
       dist = gp.Number()

Does that make any sense with what you are doing?

-Pascal


#3

Ah, this stuff hurts… but no pain no gain right? :smiley:


(Pascal Golay) #4

Yep, sure seems like hard going to me…

-Pascal


#5

Ok, nice perspective… I’ll get through it :wink: