Navisworks API

Reply
ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 11 of 18 (116 Views)

Re: Get all selected viewpoint

08-22-2012 07:35 PM in reply to: ssdiesel

unit affects this. API shows the value in document unit, while product uses meter. You can see a small 'm' atfer the values in the dialog viewpoint>edit>position.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Contributor
ssdiesel
Posts: 23
Registered: ‎02-07-2012
Message 12 of 18 (113 Views)

Re: Get all selected viewpoint

08-22-2012 07:38 PM in reply to: xiaodong.liang

ok.. but how can i translate units coordinates in meters?

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 13 of 18 (110 Views)

Re: Get all selected viewpoint

08-22-2012 07:44 PM in reply to: ssdiesel

I do not think it will be difficult for you to convert the values in different units, though Navisworks API does not provide the conversion.

 

btw, the document unit is told by Document.Units



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Contributor
ssdiesel
Posts: 23
Registered: ‎02-07-2012
Message 14 of 18 (108 Views)

Re: Get all selected viewpoint

08-22-2012 08:00 PM in reply to: xiaodong.liang

actually i dont get it how can i transform sv.Viewpoint.Position.X = 2028,...

into meters with Document.Units - enum class

 

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 15 of 18 (106 Views)

Re: Get all selected viewpoint

08-22-2012 08:17 PM in reply to: ssdiesel

no Navisworks API, but this is a math question. e.g.

 

if the document unit is foot. while 1 foot = 0.3048 meter. thus the value in meter is : value * 0.3048

 

does this make sense?



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Contributor
ssdiesel
Posts: 23
Registered: ‎02-07-2012
Message 16 of 18 (102 Views)

Re: Get all selected viewpoint

08-22-2012 08:23 PM in reply to: xiaodong.liang

Now i get it, what you want to tell me..

with Document.Units we get default doc units and after that we translate it!

 

Thx for help!

 

ADN Support Specialist
xiaodong.liang
Posts: 1,271
Registered: ‎06-12-2011
Message 17 of 18 (88 Views)

Re: Get all selected viewpoint

08-28-2012 01:19 AM in reply to: ssdiesel

exactly! glad my comment could help :smileyhappy:



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Contributor
genscripter
Posts: 24
Registered: ‎05-15-2009
Message 18 of 18 (9 Views)

Re: Get all selected viewpoint

08-15-2014 10:20 AM in reply to: xiaodong.liang

I am so aggrevated by the Navisworks API/Documentation

 

It's the simplest things that drive me crazy.  

 

How does someone get a collection or array of the savedViewpoints?

 

I can get one viewpoint, but i want to loop thru all of them.  And I want to detect where they are in the "View" tree in the Navisworks UI, like if the viewpoint is in a folder.

 

Is there a website that I'm missing that has sample codes of Navisworks scripts?  This seems extremely poorly documented.  

 

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.