Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rubberband when drawing lines with the API

Rubberband when drawing lines with the API

As a developer i need rubberband diplay when drawing lines.
A "rubberband" is the preview line that sticks to the cursor until the user picks the next point.
So it would behave in the same way as Revit does when drawing lines manually.

10 Comments
Austin.Sudtelgte
Explorer

I think it would be handy to ask a user to select two points and have a line drawn between them only make it like the standard "Draw a line" function rather than selecting two points and passing them into the current line creation function. Basically what I would like is for a phantom line to follow the mouse from the first point they selected until they select the second point.

Anonymous
Not applicable

To continue on what Håvard writes we (Symetri) have used "UI.Selection.PickPoint" to pick 2 points. Then we used the picked points to draw a line (or electrical wire) between those points. It would be really nice if we could have the API extended so that "PickPoint" could use an optional "starting point" parameter (type XYZ) and display a rubberband from this starting point (visually it would look very much like when you use the ordinary line-tool in Revit).

We saw that there also is a similar suggestion in another post on the address below:
https://forums.autodesk.com/t5/revit-ideas/prompt-user-to-draw-a-line-from-the-api/idi-p/8171807
(The description of "phantom line" is probably what we have called "rubberband".)

Anonymous
Not applicable
Kevin.Bell
Advisor

Yes - I would really like this, writing plugins without this feature makes it confusing for the user when picking points.

lionel.kai
Advisor

Something similar to AutoLISP's getdist or getpoint (that would show a line from the first point as the user is inputting the second point and/or entering the distance).

 

I created a quick-and-dirty Add-in that needs the user to input/measure a distance. However, there isn't a ready-made input function in Revit - only single-point input (or box). See also https://forums.autodesk.com/t5/revit-api-forum/equivalent-to-getdist-in-revit/m-p/9014796. I made the routine thinking it would make it easier for the drafters to not have to look up the fudge factor relating text height to schedule row height (when formatting revision schedules) - measure a distance, multiply it by a constant, then tell the user.

sgermanoZ2Y2F
Enthusiast

Agree this would be very useful to allow users to interact with api apps.

lionel.kai
Advisor
c.ooijevaar
Contributor

As a work around for now, maybe you could prompt the user to place a line based detail item which you rollback. then use that information in your code to place a normal detail line or whatever you wanted to do. 

 

still i upvoted this one. would be nice to have a more solid solution for this in the api.

lionel.kai
Advisor

@c.ooijevaar Unfortunately, that's much easier said than done. You'd have to write your code in two parts - the first part to start the line command (and setup an event listener). Then, after the user draws the line, your event listener would take the "input" from the line and do whatever... and you'd have to handle a "cancel" (Esc) during the line draw, too. Definitely not for a beginner (like me). Imagine if you needed two inputs! 🙄

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea