Navisworks API

Reply
ADN Support Specialist
xiaodong.liang
Posts: 1,301
Registered: ‎06-12-2011
Message 11 of 19 (136 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 19 (133 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,301
Registered: ‎06-12-2011
Message 13 of 19 (130 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 19 (128 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,301
Registered: ‎06-12-2011
Message 15 of 19 (126 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 19 (122 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,301
Registered: ‎06-12-2011
Message 17 of 19 (108 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

Active Contributor
genscripter
Posts: 31
Registered: ‎05-15-2009
Message 18 of 19 (29 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.  

 

 

ADN Support Specialist
xiaodong.liang
Posts: 1,301
Registered: ‎06-12-2011
Message 19 of 19 (7 Views)

Re: Get all selected viewpoint

09-28-2014 09:22 PM in reply to: genscripter

Hi genscripter,

 

I’d apology for any inconvenience our API document caused. Our document is in the progress to be better. We appreciate any of your comments.

 

I am struggling to understand your question because of the other forum thread you are discussing in. if you just need to get the collection of saved viewpoints, the way is direct. Here is the blog:

http://adndevblog.typepad.com/aec/2012/06/navisworks-net-api-2013-new-feature-saved-viewpoint.html

 

but, I think you actually wanted to get the collection of selected viewpoints, as you mentioned in the other thread. I will reply there.

 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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