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
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 Modulewww.nxjournaling.com
RE: Journal to Select FlatSolid
Helpful as always