I found a sample journal in the gtac solution center. so I don't think I can post the whole thing publicly.
it opens and exports all surfaces and solids into parasolid file of the same name, cycling through all the folders and subfolders.
I was hoping to be able to edit it to ask what version of parasolid(or default to an older version) to export and only export what is displayed when you open the prt file.
not all the hidden bodies and turned off layers.
but nothing pops out as obvious things to be able to edit. It doesn't help that I barely remember BASIC from the commadore PET's in HS.
I believe this is the selection part
Sub OpenAndSave(ByVal pspec As String)
Dim basePart1 As BasePart
Dim partLoadStatus1 As PartLoadStatus = Nothing
Dim partSaveStatus1 As PartSaveStatus = Nothing
s.Parts.LoadOptions.ComponentsToLoad = LoadOptions.LoadComponents.None
basePart1 = s.Parts.OpenBaseDisplay(pspec, partLoadStatus1)
Dim inx As Integer = 0
Dim dispPart As Part = s.Parts.Display
Dim bodies As BodyCollection = dispPart.Bodies
Dim bodyCount As Integer = bodies.ToArray.Length
Dim tagList(bodyCount - 1) As NXOpen.Tag
Dim pspec1 As String = pspec.Replace(".prt", ".x_t")
Do
tagList(inx) = dispPart.Bodies.ToArray(inx).Tag
inx = inx + 1
Loop Until inx = bodyCount
ufs.Ps.ExportData(tagList, pspec1)
If (partLoadStatus1.NumberUnloadedParts() = 0) Then
partSaveStatus1 = basePart1.Save(BasePart.SaveComponents.False, BasePart.CloseAfterSave.True)
partSaveStatus1.Dispose()
Else
reportLoadStatus(partLoadStatus1)
s.Parts.CloseAll(BasePart.CloseModified.CloseModified, Nothing)
End If
partLoadStatus1.Dispose()
End Sub
Public Function select_directory(ByRef foldername) As System.Windows.Forms.DialogResult
Dim fbd As FolderBrowserDialog
Dim result As System.Windows.Forms.DialogResult
fbd = New System.Windows.Forms.FolderBrowserDialog()
fbd.Description = "Select directory to check"
fbd.ShowNewFolderButton = False
fbd.SelectedPath = foldername
result = fbd.ShowDialog()
foldername = fbd.SelectedPath
fbd.Dispose()
Return result
End Function
/