I am using AutoCAD overrules to display text over some objects. This text is used as a "label" to display information about this item.
One of the rmequirements of this is that the text is ALWAISE displayed strait for the user (horizontaly), no matter what the rotation of the object in question is and NO MATTER THE ROTATION OF THE CURRENT VIEW AND UCS. This is fairly simple, and works great, except for one thing:
Right now, every time the overrule method is called, I have to re-calculate the current UCS rotation according to the WorldUCS (rotation of the text object = Current UCS Rotation - Current View Rotation [based on current UCS]). The Curent view rotation is calculated / stored every time the current view changes (ViewChanged event), so I don't have to recalculate it.
So I am looking for a way to register the UcsChanged event so I can simply recalculate the rotation value when it changes instead of doing it for all of the objects in the drawing. I have found the event itself in the object browser (Autodesk.AutoCAD.Internal.Reactors.UcsEventManager.UcsChanged), but I can't seam to find an instance of the UcsEventMaager to hookup to.
The reason I described this in details is that there may be a simpler solution. Any ideas?
Has anybody ever done this? Do I need another References?
Also, please indicate (if possible of course) where in the documentation (ObjectARX or Developer's documentation or whatever) I coud find this information!
Thanks alot for any support!
Assuming you're talking about a Drawable
overrule, and overriding its WorldDraw(),
you should be using ViewportDraw() for
what you're trying to do.
What if there's multiple viewports showing
the same object in different view orientations?
Haha, thanks for the info... But will it apply in Model (is ModelSpace also a viewport)?
And... it doesn't help me with my question, right? Or is there something in the args of the event that allows me have the rotation values?
Thanks for the response!!!
Yes, it applies to model space views too.
I don't have it in front of me, but the arguments passed into ViewportDraw should give
you the needed view transformation for the view. ViewportDraw() is called once for
each viewport.
Can't find what you're looking for? Ask the community or share your knowledge.