[V8i C++] Turning on snapping for transients

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
, and in OnComplexDynamics I have:

transientElement_ = (TransDescrP)mdlTransient_addElemDescr(transientElement_, descriptor, TRUE, 0x00FF,
                                                                   DRAW_MODE_TempDraw, TRUE, TRUE, TRUE);
, where 
descriptor
is MSElementDescrP of my element.

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

Parents Reply
  • 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



Children
No Data