[CONNECT C++] DependencyManager - How to obtain the "current" Viewport when DependencyManager handles and Event?

I'm writing a DependencyManager handler and I need to know the RotMatrix of the view where my element modification caused the DependencyManager to act. Specifically, when my Root element alters it's rotation, I need to also modify the rotation of any dependent items. I am trying to use GetCurrentDgnButtonEvent(), but I don't have any type of DgnTool active, so the compiler doesn't like me using it....

Not sure of any other way to obtain the Viewport of the cursor operation. Do I need to set up a view monitor as well in order to get this information? Might it be available from the tcb?

Parents
  • You can't know what (if any) viewport received the interaction that resulted in a dependency callback. Dependency callbacks are about persistent changes to elements triggering changes to other elements; they cannot be view-dependent.

    Why do you think you need a viewport? What are you trying to use it for?

  • I have text that is placed on top of a line. The text must remain oriented with the line, but additionally must always read from the bottom and/or right side of the view:

    Original:                         Incorrect:                                           Correct:

        

    If you reposition the bottom vertex from the left to the right, the text must follow the tangent of the segment AND be orientated such that "top" (upper 'Y' of text box) of the text is above the "bottom" (lower 'Y' of text box). I suspect one could extract out the boundary of the text and compare the 'Y' values, but What I've been doing is simply taking the segment tangent and rotating it by the view rotation to get the segment tangent in relation to the view instead of the global coordinate system. Once I know that, if the tangent is > 91 and < 269 degrees, I know to additionally rotate the text 180 degrees. All this assumes that once the line/text is placed, that the view is not rotated again....

Reply
  • I have text that is placed on top of a line. The text must remain oriented with the line, but additionally must always read from the bottom and/or right side of the view:

    Original:                         Incorrect:                                           Correct:

        

    If you reposition the bottom vertex from the left to the right, the text must follow the tangent of the segment AND be orientated such that "top" (upper 'Y' of text box) of the text is above the "bottom" (lower 'Y' of text box). I suspect one could extract out the boundary of the text and compare the 'Y' values, but What I've been doing is simply taking the segment tangent and rotating it by the view rotation to get the segment tangent in relation to the view instead of the global coordinate system. Once I know that, if the tangent is > 91 and < 269 degrees, I know to additionally rotate the text 180 degrees. All this assumes that once the line/text is placed, that the view is not rotated again....

Children