Measure Point Coordinates with vb.net

Measure Point Coordinates with vb.net

markus_leopoldsederYKXWM
Explorer Explorer
405 Views
7 Replies
Message 1 of 8

Measure Point Coordinates with vb.net

markus_leopoldsederYKXWM
Explorer
Explorer

I want to create a plugin for Navis Simulate/Manage which reads the lines in a textfield. For each line i want to start the Measure Point Dialog and write the coordinates into a new textfile.

I am very new to the programming topic, i can create the plugin, read the lines in the textfile (shown in a Messagebox always comming up) and write "something" into a new textfile.....

So the mainthing is still missing:

How to "jump" into the measure point dialog, get the coordinates and return to the plugin execution.

 

Is this possible ? Has somebody maybe an example code in VB.NET or some tips ?

 

Thanks

     Markus

0 Likes
Accepted solutions (2)
406 Views
7 Replies
Replies (7)
Message 2 of 8

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @markus_leopoldsederYKXWM ,

 

Could you please clarify what you mean by "Measure Point dialog"?

Are you referring to the dialog shown in the link below?

https://help.autodesk.com/view/NAV/2025/ENU/?guid=GUID-E0E92E2A-E8F4-4FC1-AB2F-BFD0CCEA1012 

In that dialog, are you interested in retrieving the Start Point, End Point, Difference, and Distance values?

Please confirm if my understanding is correct. If not, could you kindly explain the issue further, preferably with a screenshot?

Also, Could you please let me know which Navisworks Version you are using?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 8

markus_leopoldsederYKXWM
Explorer
Explorer

Hi naveen.kumar.t, thank you for your reply.

 

I want to get the coordinates of a single point (please see attached screenshot).

 

The idea is: i get a Textfile with names of instruments in it.

In Navis i want to read this Textfile line by line.

For each line a Messagebox appears and asks "Where is <line1> ?"

(so far i could realize it....)

Then the Measure point dialog should open and it should be possible to navigate to a position and klick for selecting this measuring point.

After selecting this point, the coordinates of this point should be written to a Textfile and the next Line should be processed.

(writting to a Textfile i also could manage, but not the "magic" inbetween.......)

 

I have NAVISWORKS Simulate and Manage Version 2025.

 

Thank you

       Markus

0 Likes
Message 4 of 8

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @markus_leopoldsederYKXWM ,

 

First, yes, it is possible to retrieve the Measure Single Point Coordinate Value via the Navisworks API. However, it only returns the value of an already existing measurement. I am uncertain how this would integrate into your workflow.

Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
DocumentCurrentMeasurement documentCurrentMeasurement = doc.CurrentMeasurement;
if (documentCurrentMeasurement.Tool == Tool.MeasureSingle)
{
    if (documentCurrentMeasurement.HasFirstPoint)
    {
        Point3D p3D = documentCurrentMeasurement.FirstPoint;
        MessageBox.Show(p3D.ToString());
    }
}

 

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 8

markus_leopoldsederYKXWM
Explorer
Explorer

Hi naveen.kumar.t

 

Thank you for your helpful reply.

Is it also possible to create an external application with vb.net and use this function you described or is it only possible as plugin ?

With an external application i think my workflow would be easier to realize....

 

I have tried already, but i always get an Error an i am not sure if it is some missconfiguration or anyway not possible......

 

thanks

   Markus

0 Likes
Message 6 of 8

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @markus_leopoldsederYKXWM ,

 

What do you mean by "external application"?
Are you trying to do this using a console application?
So, when the console application runs, it will open Navisworks and perform the required actions?
Are you planning to use the Navisworks Automation API in VB.NET?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 7 of 8

markus_leopoldsederYKXWM
Explorer
Explorer

Hi @naveen.kumar.t 

The plan  was to create an .exe apllication with a windows form in vb.net and ineteract with an open Navis Session.

I now, with your support, created a plugIn which exports the coodinates of the last measuring point into a .csv file when klicking on the PlugIn Button in the Toolbar.

This is very helpful for us.

But maybe for future projects it would be interesting if the API supports all navis functions not only in a plugIn but also with an external .exe application....

 

Many Thanks

     Markus

0 Likes
Message 8 of 8

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @markus_leopoldsederYKXWM ,

Please take a look at the MDIViewer and SDIViewer projects located in the Navisworks SDK under NET\Examples\Controls\Viewers.

These examples closely align with the functionality you're aiming to implement in Navisworks.

All the controls are presented in the Autodesk.Navisworks.Api.Controls namespace and are usable from the Visual Studio forms designer.


https://apidocs.co/apps/navisworks/2018/87317537-2911-4c08-b492-6496c82b3ed8.htm


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network