Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
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.
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
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!
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.