×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NX - Total Length of Sheet Boundaries

NX - Total Length of Sheet Boundaries

NX - Total Length of Sheet Boundaries

(OP)
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

RE: NX - Total Length of Sheet Boundaries

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 --> VB

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
www.technisites.com.au

RE: NX - Total Length of Sheet Boundaries

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.

RE: NX - Total Length of Sheet Boundaries

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources