How can you obtain the ilplotcube rotatation information at runtime?

211 views Asked by At

Suppose I plot a surface and at runtime I use the mouse to rotate the surface. Once the right rotation of the surface is achieved, how I can get its state?

2

There are 2 answers

0
user492238 On

Each driver creates a clone of the global scene which is constantly synched and updated with changes in its source. The rotation is done on the clone. I have not tested it, but I think, you can query objects (e.g. the plot cube) in the clone by

panel.GetCurrentScene().First<ILPlotCube>(/*your filter if needed*/) 

This instance will reflect all changes done by the user.

0
Haymo Kutschbach On

The method pointed out in user492238s answer does work. However, GetCurrentScene() assembles a new scene as composition of the global and the local (to the current driver) scene. This can get costly if called frequently. If only individual objects / properties are needed, panel.SceneSyncRoot can be used instead.

Also, the rotation of a plot cube is exposed by the plotcube.Rotation property. So, in order to get the current rotation of a plot cube (including the rotation due to user input):

panel.SceneSyncRoot.First<ILPlotCube>().Rotation