Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DeviationGauge tool - NX Open 1

Status
Not open for further replies.

Frank2288

Mechanical
Nov 20, 2015
38
0
0
IT
Hi, i am trying to call/use the deviation gauge analysis tool in NX Open to measure the distance between a set of surfaces and a set of facets (STL) imported in Siemens NX.

Is there a way to have access to have access to a numerical value describing the distances between the couples of points considered by the tool? In other words: whenever i use the DeviationGauge directly from Siemens NX i see the distance values visualized on the screen. Using it in OpenNX, i need something like it. This is for me the analysis result, and it's what i need to use in my code.

 
Replies continue below

Recommended for you

Just to clarify what could be misinterpretated: what i need is a way to access the values in FIG, directly from the NXOPEN code.
The most ideal condition would be to have access to all the values of the STL points, but MAX and MIN values could do.



distanza_stl.JPG
 
There is Snap.Compute.DeviationInfo, but not sure if it works on facetted bodies.

Or, you could cycle through the vertices of the facetted body and measure distance from each one to your surface.

Or, sometimes you can persuade an NX measurement function to send its output to a text file, instead of the listing window. Then your code has to hunt through the text file to get the info you need.

 
Thanks BubbaK for your answer!

I tried Snap.compute.DeviationInfo, but in my experience it does not work on facetted bodies.

The second option is the solution that i am trying to pospone as my final possibility.

The third thing is actually what i am trying to do. That would be perfect, but i think that my lack of knowledge in programming and VBA is what is slowing me. I cannot find the output of the measurement function anywhere, i don't know where it is stored. It seems impossible that it is only visualized in the software environment but not accessible in code, isn't it?


Thanks again, i am really stuck with this problem!
 
To get output to a file, it sometimes works to do

NXOpen.ListingWindow.ListingWindow.SelectDevice(NXOpen.ListingWindow.DeviceType.File, filePathString)
 
Sorry once again for my trivial questions.
maybe i need to clarify my problem:

I do have a couple of ideas to get a file output with OPEN, but i can not locate where the data that i need is stored (the results of DeviationGauge, correctly visualized in the NX environment, see figure)!


distanza_stl_szyjka.jpg
 
When you make this call

NXOpen.ListingWindow.ListingWindow.SelectDevice(NXOpen.ListingWindow.DeviceType.File, filePathString)

you are *telling* NX where to put the results. That's what the filePathString argument is -- it's the pathname of the file where you want the output to be written (instead of being written to the listing window).
 
Thank you again.

I used your suggestion, but the file comes out empty. Is this possible? Am i doing something wrong? (highly possible ;) )
 
This is what i wrote:

Code:
Dim lw1 As ListingWindow
        lw1 = theSession.ListingWindow
Dim myDocs As String
        myDocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
Dim outputFile2 As String = IO.Path.Combine(myDocs, "testlog.txt")
        
lw1.Open()
        lw1.SelectDevice(ListingWindow.DeviceType.FileAndWindow, outputFile2)
        lw1.Close()


This is what i get:

============================================================
Information listing created by : Francesco
Date : 03/03/2016 12:51:00
Current work part : C:\Users\Freng\Desktop\NX\flangia_finale2.prt
Node name : desktop-a5qleao
============================================================
Filename: C:\Users\Freng\Desktop\NX\flangia_errore_segmentata\flangia_errore_segmentata_2.stl

Number of topologies 1

Topology 0 contains 22264 facets

Total number of facets used 22264
Total degenerate facets 0
 
maybe the distances that i am able to see in the NX environment (associated with the analysis?) can not be reported in the listing window?

 
3ddata_nhdtdb.png


This is the data that i need, but i can only see/read it in the 3D view of the software. Every evaluated distance is reported on the corresponding point of the STL.
 
The distances are not actually listed in the listing/information window. The step that i miss to be able to print the data is exactly that. In the "deviation gauge" window there is no option to send the data to the information window (as in the "measure minimum distance" tool, for example), and i don't know how to do it.
 
In interactive mode ( i.e not running code to do this) , If i leave ( OK) the deviation gauge, it will still be displayed on screen. Then select the deviation gauge and do a Information - Object ( Ctrl+ I) NX will produce the report you are looking for.

Regards,
Tomas

 
Hi Toost, thanks for your answer, it's very helpful and i will try it as soon as possible.

Is there a way to do it from code also?

Thanks again

 
Status
Not open for further replies.
Back
Top