Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
This page has been translated for your convenience with an automatic translation service. This is not an official translation and may contain errors and inaccurate translations. Autodesk does not warrant, either expressly or implied, the accuracy, reliability or completeness of the information translated by the machine translation service and will not be liable for damages or losses caused by the trust placed in the translation service.Translate
Submitted byAnonymouson11-27-201801:07 AM
Status:
Gathering Support
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.
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.
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).
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.
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.
@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! 🙄