×
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

Journal to Select FlatSolid

Journal to Select FlatSolid

Journal to Select FlatSolid

(OP)
I have an existing journal to work through an assembly and extract bounding box information for each component in the assembly for BOM purposes. This works well except for formed components, where we want to bound box only the FlatSolid of the component. Does somebody know the code to do this? Find and select the FlatSolid only.

RE: Journal to Select FlatSolid

The following journal shows one way to do it.

CODE

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

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

    Dim theUI As UI = UI.GetUI()
    Dim lw As ListingWindow = theSession.ListingWindow

    Sub Main()

        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "find flat solid")

        lw.Open()

        Dim myFlatSolid As Body = Nothing

        For Each tempBody As Body In theSession.Parts.Work.Bodies

            Dim parentFeats() As Features.Feature = tempBody.GetFeatures
            For Each tempFeat As Features.Feature In parentFeats
                If TypeOf (tempFeat) Is Features.FlatSolid Then
                    myFlatSolid = tempBody
                End If
            Next
            lw.WriteLine("")
        Next

        lw.WriteLine("flat solid body tag: " & myFlatSolid.Tag.ToString)

        lw.Close()

    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

    End Function

End Module 

www.nxjournaling.com

RE: Journal to Select FlatSolid

(OP)
Thank you sir!
Helpful as always

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