Navisworks API

Navisworks API

Reply
New Member
TylerEmptage
Posts: 2
Registered: ‎11-07-2012
Message 1 of 3 (384 Views)

Camera navigation plugin with 2012 API and COM API

384 Views, 2 Replies
11-07-2012 11:26 AM

Hi all,

 

I'm building a camera control plugin for a 3D mouse to do navigation in Navisworks 2012 with the plugin API and COM API (since 2012 doesn't support robust camera manipulation in the standard .NET API as far as I know). It looks like I may be able to do this in a more robust manner in the 2013 API (I haven't upgraded yet and am unsure when that would happen) with new .NET API support for camera manipulation, but for the sake of getting it up and running in 2012:

 

I set up a thread that polls data from my device and uses it to update the translation and rotation of the camera using the COM API. When I do this directly in a C# plugin, the performance is terrible. However, I found a sample camera manipulation plugin from 2010 that utilizes a Windows Form to do one-off camera moves and rotations. When I ran my code through the Windows Form (that opens as a modal dialog in the main thread, suspending the Navisworks window), the performance is MUCH closer to normal/acceptable range. So this is usable but not ideal since I have to close the Windows Form to resume normal Navisworks operation and open the plugin again everytime I want to navigate with my 3D mouse.

 

Is there anyway to circumvent this and get decent performance/framerate when manipulating the camera in real time directly in a C# plugin with the COM API? Maybe the COM functionality wasn't built for this sort of application, but I was wondering if there was something I was missing that could alleviate whatever calculations Navisworks is doing every time the camera transformation gets reset. I also think it could be related to Naviswork's logging of Undo actions since the Undo button flickers every time the camera is moving. Is there a way to disable logging of Undo actions for camera moves or Undo actions in general? I can set the Undo buffer size to 0 in Options but that doesn't seem to make a difference.

 

Thanks

ADN Support Specialist
xiaodong.liang
Posts: 1,335
Registered: ‎06-12-2011
Message 2 of 3 (340 Views)

Re: Camera navigation plugin with 2012 API and COM API

01-07-2013 10:49 PM in reply to: TylerEmptage

Hi,

 

Similar to what I replied in the other post  (http://forums.autodesk.com/t5/Autodesk-Navisworks-API/Viewpoint-manipulation-and-threading-in-2013-N... ), there are some blogs on 2013 new API of camera. Probably you could give it a try?

 

it looks one of your problems is about undo.  did you group the operations (so you would face the issue of undo)? Have you used  BeginEdit & EndEdit? They are grouping the operations.  I can misunderstand your problem, though.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Contributor
temptage
Posts: 19
Registered: ‎11-12-2012
Message 3 of 3 (331 Views)

Re: Camera navigation plugin with 2012 API and COM API

01-08-2013 10:03 AM in reply to: xiaodong.liang

I have been using BeginEdit and EndEdit surrounding my camera translation and rotation code in my current Forms implementation and it certainly helps. Without it, moving the camera on two separate axes (both forward and to the right for a diagonal move, for instance) leads to a stair-stepping/jagged motion relative to much smoother motion when the operations are grouped.

 

I seem to remember this didn't provide noticible performance improvement with the original threading implementation, though, but I can try to test this out again. Either way, I'll put some time into getting this working in the 2013 .NET API which may circumvent this particular probelm.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.