Hi,
I would like to display snappable temporary element in OnComplexDynamics method of my custom tool. So I tried to use transient element and DRAW_MODE_TempDraw:
In my tool I defined member
TransDescrP transientElement
transientElement_ = (TransDescrP)mdlTransient_addElemDescr(transientElement_, descriptor, TRUE, 0x00FF, DRAW_MODE_TempDraw, TRUE, TRUE, TRUE);
descriptor
In above call the snappable flag is turned on. However obtained transient is not snappable during dynamics event. Interestingly, when I start another tool, e.g. insert line, that transient is snappable, and after reloading my tool, new inserted element is also snappable, also during dynamics.
How to control this behavior?
Thanks
Wojciech
Wojciech said:I would like to display snappable temporary element in OnComplexDynamics method of my custom tool. So I tried to use transient element
Transient elements are not intended to be created in dynamics. Transient elements stick around until you explicitly remove them, their container disappears, or you exit MicroStation.
Create a transient element before you start your primitive tool.
Regards, Jon Summers LA Solutions
Thanks Jon,
But I need to create the element during dynamics. Is there a way to do it with snapping feature?
Wojciech said:I need to create the element during dynamics
An element created in dynamics is in-memory. It doesn't belong to a model. There's nothing to snap to.
Please describe how your tool will work. I'm having difficulty imagining how you would snap to the element that you are drawing in dynamics.
Jon Summers said: I'm having difficulty imagining how you would snap to the element that you are drawing in dynamics.
Place SmartLine tool is able to snap to itself, even when the element is not saved to active file yet.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
I need to make a tool which can modify a face of a solid. During modification I would like to display auxiliary lines to which the normal vector of a moving face can snap.
Wojciech said:I need to make a tool which can modify a face of a solid. During modification I would like to display auxiliary lines to which the normal vector of a moving face can snap
That's a statement, not a question! How should we respond?
If your question is about drawing temporary auxiliary lines while a tool is active, then ask a new question. It's not exactly clear how your tool should operate, so how about an annotated DGN mock-up showing the tool in progress?
Thanks, I'll ask a new question.
Jan Šlegr said:Place SmartLine tool is able to snap to itself, even when the element is not saved to active file yet.
Sounds like everything has been resolved here, but I wanted to clarify something about SmartLine...
The transients aren't created in dynamics, the transients are created/updated on the data and reset button events and only include the "accepted" segments. The "current" segment, that is changing every dynamics frame, isn't included in the transient geometry.
For a snappable transient to make sense it needs to be somewhat "stable", which seems like the case here...OnComplexDynamics just wasn't the right place to create them.
HTH
-B