Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX - Total Length of Sheet Boundaries 1

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
Hi,

I can use the analysis function "Examine Geometry" to report the number of "Sheet Boundaries" I have on a sheet body. What I would also like to get is the total length of these sheet boundaries. Any method I have tried includes tangent edges between faces (for example the tangent edge between a fillet and the adjacent surface), but I only want the edges that don't border another edge (exactly what the "Sheet Boundaries" shows).

Is there a way I can get these lengths?

Thanks,
Jeff
 
Replies continue below

Recommended for you

A sheet boundary edge will always have a single face. Below is a journal that gives the total length of sheet boundary edges. (A quick hack of a similar existing journal from Solution Center).

Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI

Module get_length_of_sheet_boundary_edges

    Dim theSession As Session = Session.GetSession()
    Dim ufs As UFSession = UFSession.GetUFSession()

    Dim lw As ListingWindow = theSession.ListingWindow

    Sub Main()

        Dim dp As Part = theSession.Parts.Display

        Dim theBody As Body = select_a_body("Sheet Body to process:")

        If theBody Is Nothing Then
            Return
        End If

        Dim theEdges() As Edge = theBody.GetEdges()

        Dim newCurveCounter As Integer = 0

        Dim boundaryLengths As Double = 0

        For Each thisEdge As Edge In theEdges
            Dim theFaces() As Face = thisEdge.GetFaces()
            If theFaces.GetLength(0) < 2 Then

                boundaryLengths += thisEdge.GetLength()

                newCurveCounter += 1
            End If
        Next

        lw.open()
        lw.WriteLine("Found " & newCurveCounter & " sheet boundary edges")
        lw.WriteLine("Total length of sheet boundary edges is " & boundaryLengths)

    End Sub

    Function select_a_body(ByVal prompt As String) As Body
        Dim mask() As Selection.MaskTriple = {New Selection.MaskTriple( _
            UFConstants.UF_solid_type, 0, UFConstants.UF_UI_SEL_FEATURE_SHEET_BODY)}
        Dim cursor As Point3d = Nothing
        Dim obj As TaggedObject = Nothing

        Dim resp As Selection.Response = _
            UI.GetUI().SelectionManager.SelectTaggedObject("Select a body", prompt, _
            Selection.SelectionScope.AnyInAssembly, _
            Selection.SelectionAction.ClearAndEnableSpecific, _
            False, False, mask, obj, cursor)

        Return obj
    End Function

    Sub Echo(ByVal output As String)

        theSession.ListingWindow.Open()
        theSession.ListingWindow.WriteLine(output)
        theSession.LogFile.WriteLine(output)

    End Sub

    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        Return Session.LibraryUnloadOption.Immediately
    End Function

End Module

Suresh
 
Or you could use the extract geometry composite curve feature with the rule selection set to sheet edges. Then use the length measure with selection rule set to feature curve to get all curves belonging to the composite curve.
 
Thanks Petulf!

I thought there was something for sheet edges, but for some reason when I looked for it I only saw face edges and sheet bodies as selection rules. But I see now that I missed the sheet edge selection rule.

Suresh,

Your journal does provide the total length I am looking for, but it doesn't report the correct number of sheet boundaries. It seems to provide the total number of edges, but a single sheet boundary (as reported by examine geometry) could contain more than one edge.

Jeff

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor