Cancel
Showing results for 
Search instead for 
Did you mean: 

read the tolerance value of a tolerant edge

Genius
Genius
Is it possible to read the tolerance value of a tolerant edge in Snap or NXOpen?
 
I try to do it, but can't find a class like "Snap.NX.Edge.SpCurve".
 
Thanks!
 
Image.png
 
Image.png
17 REPLIES

Re: read the tolerance value of a tolerant edge

Legend
Legend

Hi @surfactant ,

you can try this : NXOpen.UF.Modeling.AskEdgeTolerance

Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Re: read the tolerance value of a tolerant edge

Genius
Genius

Hi @mkn   Let me try it. Thank you!

Re: read the tolerance value of a tolerant edge

Genius
Genius

NXOpen.UF.Modeling.AskEdgeTolerance is a python method.

 

Is there an equivalent for .NET? I searched the NXOpen reference guide, but failed to find one. Thanks!

 

 

 

Re: read the tolerance value of a tolerant edge

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The .AskEdgeTolerance method is also available for the .net languages.

 

https://docs.plm.automation.siemens.com/data_services/resources/nx/12/nx_api/custom/en_US/nxopen_net...

Re: read the tolerance value of a tolerant edge

Genius
Genius

Hi @cowski1   Thank you!

 

I can't find the NXOpen.UF namespace in the NXOpen API Reference for NX11. Searching "NXOpen.UF" gives nothing.

 

And in Visual Studio it looks like this:

 

Image.png

 

Maybe it's unavailable in NX11.

Highlighted

Re: read the tolerance value of a tolerant edge

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Up through NX 10, all the API functions are documented in a single .chm file. For some unknown reason, they decided to split the reference into 2 .chm files for NX 11 (one contains all the UF functions).

 

Visual studio isn't helping because you are calling it incorrectly. You will need a reference to the UF session; then you can call the .AskEdgeTolerance method via your UF session object.

 

The code will end up looking something like the following:

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module112
    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim theUfSession As UFSession = UFSession.GetUFSession
        Dim workPart As Part = theSession.Parts.Work
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        Dim myEdge As Edge
        'add your code to get edge of interest
        Dim myEdgeTol As Double
        theUfSession.Modl.AskEdgeTolerance(myEdge.Tag, myEdgeTol)

        lw.WriteLine("Edge: " & myEdge.Tag.ToString)
        lw.WriteLine("Edge tolerance: " & myEdgeTol.ToString)

    End Sub

Re: read the tolerance value of a tolerant edge

Genius
Genius

Hi @cowski1   Very clear explanation. And the code is really helpful. Thank you so much!

Re: read the tolerance value of a tolerant edge

Legend
Legend

Sorry @surfactant , I put this link, because it is easier for me to look in for doc Python that doc NXOpen.NET , I don't know Python , but when I try to find an class or an function Vb.net , the entry Quick search is very convenient

Production: NX11.0.2.7,VERICUT 8.1.2
Development: Tcl/Tk, Gnuplot
www.adgroupe.com

Re: read the tolerance value of a tolerant edge

Genius
Genius

Hi @mkn   Thank you for your information!