Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get coordinates from measurements

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
1172 Views, 3 Replies

Get coordinates from measurements

Hello,

 

I'm working a lot with point cloud data, where the location of certain features often is of interest. Since the measure tool is the only way of obtaining the coordinates of objects, the workflow is to measure and then copy+paste the coordinates into a text editor.

But when it comes to obtaining hundreds of point coordinates, this procedure is really ineffective and cumbersome.

 

What I'd like to do is to create a plugin that captures the coordinates/points of the measurement tool and then writes to a text file.

A smooth way would be to use the event when the measurement tool is used, and write directly to a file. Another way would be to use the point line tool to measure several points and then export them all at the same time to a text file (assuming all attach points are saved/accessible).

 

So my main question is: How do I get hold of the coordinates of the measurement tool? Where are they in the API?

 

I'm new to API programming, so if anybody would like to help out further with the syntax, I'd be very thankful.

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Look in the COM Documentation

 

Example 

 

"C:\Program Files\Autodesk\Navisworks Simulate 2012\api\COM\documentation\NavisworksCOM.chm"

 

the Object "InwOpState3:" 

 

Has four Methods Called

 

GetMeasureFirstPos

GetMeasureEndPos

GetmeasureDiff

GetMeasureValue

 

I will try to put together some sample code for a how to when I get some time. Please note that these COM API's may not even work.   

 

 

Colin

 

 

Message 3 of 4
Anonymous
in reply to: Anonymous

Are the measurement coordinates available only in the COM API, and not in the .NET API?

 

What would in that case be the easiest way to obtain the coordinates in a plugin - using the ComApiBridge/ComInterop?

 

 

Thanks for your help!

Message 4 of 4
Anonymous
in reply to: Anonymous

Using the ComApiBridge is the right way.

Autodesk.Navisworks.Api.Interop.ComApi.

 

Autodesk.Navisworks.Api.Interop.ComApi.InwOpState10 myState;

myState = Autodesk.Navisworks.Api.ComApi.ComApiBridge.State;
InwLPos3f loPos1 = myState.GetMeasureFirstPos();
InwLPos3f loPos2 = myState.GetMeasureEndPos();
InwLVec3f loVec = myState.GetMeasureDiff();

 

And so on. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report