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
Wojciech said:How to control this behavior?
Maybe this discussion helps?
Jan Šlegr said:Maybe this discussion helps?
Well remembered, Jan!
The project I linked in that discussion has an invalid URL (the discussion is from 2010). Here's a correct link to that C++ transient project. Keep in mind that it was developed for MicroStation V8.
Here's a link to a similar project for CONNECT. I don't recall whether I tested it or just copied the code.
Jon Summers said:Keep in mind that it was developed for MicroStation V8.
Which is exactly the context of the current discussion :-)
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.