Sysvars not updating while commands are active - Help

Sysvars not updating while commands are active - Help

jmassengale
Explorer Explorer
405 Views
1 Reply
Message 1 of 2

Sysvars not updating while commands are active - Help

jmassengale
Explorer
Explorer

I have a custom object that displays based on view. I have an editor reactor setup that is triggered by viewChange. Within the view change I get the following setvars: ViewDir, ViewCtr, ViewSize and ScreenSize.

 

What appears to happen is that when I pan or zoom via the mouse it seems to trigger the viewChange and these variables update based on the current viewport.

 

If a command is active like Line or 3dPoly the viewChanged is triggered but these system variables don't update while in an active command.

 

Another command is Orbit which triggers 3dOrbit, while in this command the above is also the case.

 

I am using the acedGetVar to retrieve these variables.

 

Is there an alternative method I should be using to get the updated values of these variables while commands are active. Or is there a way to get the View information. CAD is updating the display but I am just unable to query these until a command is NOT active.

 

 

Thanks

Jim

0 Likes
406 Views
1 Reply
Reply (1)
Message 2 of 2

tbrammer
Advisor
Advisor

The usual way to implement view dependent graphics is to overwrite subViewportDraw(AcGiViewportDraw*).

Your subWorldDraw() overwrite must return Adesk::kFalse to make sure that subViewportDraw() is called.

This way you can make sure that your entity is displayed correct even if there are multiple viewports visible at the same time.

I think even if you would find a suitable reactor that is fired upon view direction or zoom change you would not be able to modify the entity display in the graphic system within the current command.

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes