How can I modify this journal, to select multipe bodies to export to a temp part, as opposed it just selecting one body to export?
Thanks in advance!
Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim theUFSession As UFSession = UFSession.GetUFSession()
Dim abody As Body = SelectABody("Export")
Dim objects() as Tag = { abody.Tag }
Dim options as UFPart.ExportOptions
With options
.expression_mode = UFPart.ExportExpMode.CopyExpShallowly
.new_part = True
.params_mode = UFPart.ExportParamsMode.RemoveParams
End With
theUFSession.Part.ExportWithOptions("C:\temp\6118251.prt", 1, objects, options)
End Sub
Function SelectABody(ByVal prompt As String) As Body
Dim ui As UI = GetUI()
Dim mask(0) As Selection.MaskTriple
With mask(0)
.Type = UFConstants.UF_solid_type
.Subtype = UFConstants.UF_solid_body_subtype
.SolidBodySubtype = 0
End With
Dim obj As NXObject = Nothing
Dim cursor As Point3d = Nothing
ui.SelectionManager.SelectObject(prompt, "Select a body", _
Selection.SelectionScope.AnyInAssembly, _
Selection.SelectionAction.ClearAndEnableSpecific, _
False, False, mask, obj, cursor)
Return obj
End Function
End Module
Thanks in advance!