Managing ViewCube using Revit API

Managing ViewCube using Revit API

Anonymous
Not applicable
980 Views
1 Reply
Message 1 of 2

Managing ViewCube using Revit API

Anonymous
Not applicable

Hello, I have some questions related to the ViewCube in Revit.

 

First of all, I want to know, as a Revit API user, if there are any notifications I can receive when the user clicks any of the preset views on the viewcube (i.e. TopView, LeftView etc.). I want to run a specific code of mine when the user changes the view using the viewcube. Also, since using the viewcube implies some view change animations, it would be best for me if I could know when the animation starts and when it ends (So I would need two events, but if this is not possible, at least one of the two will do).

 

In case neither of the above is possible, I would like to at least temporary hide the viewcube during my transaction, so I would need to know if the view cube is visible or not on the screen, and in case it is I would need to hide it before starting my transaction and show it again only after my transaction ends. The only hint I found while jotting through the Revit API Documentation was this:

 

RevitCommandId showViewCubeId = RevitCommandId.LookupPostableCommandId(PostableCommand.ViewCube);
commandData.Application.PostCommand(showViewCubeId);

 

But it produced no results whatsoever.

I also tried to get the command id using RevitCommandId.LookupCommandId("ID_SHOW_VIEWCUBE"), and I did actually get the same command id, but to no avail, because posting it produces no effects.

And even if this did work, I would've still needed to know whether or not the viewcube was already shown so as to decide when to post that command and when not to.

 

Thank you very much in advance!

0 Likes
Accepted solutions (1)
981 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

I am not aware of any API access whatsoever to any aspects of the view cube.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder