08-28-2020
11:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-28-2020
11:50 AM
Here's the code I was using to try to get the available formats, in case you or others want to try to get it to work.
I've used this same sub in other situations successfully, but for some reason this situation it just doesn't want to work for me.
Sub Main
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
If oPDoc.PropertySets.Item("Design Tracking Properties").Item("Document SubType Name").Value = "Sheet Metal" Then
Dim oSMDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
MsgBox("FlatPattern was Nothing.", , " ")
oSMDef.Unfold
oSMDef.FlatPattern.ExitEdit
Else
' MsgBox("FlatPattern was already not Nothing.", , " ")
End If
Dim oFormats() As String
Dim oStorageTypes() As StorageTypeEnum
Try
' oSMDef.DataIO.GetOutputFormats(oFormats, oStorageTypes)
oSMDef.FlatPattern.DataIO.GetOutputFormats(oFormats, oStorageTypes)
' oSMDef.FlatPattern.SurfaceBodies.Item(1).DataIO.GetOutputFormats(oFormats, oStorageTypes)
If oFormats.Length > 0 Then
' a = InputListBox("Output Formats",oFormats)
For Each oFormat As String In oFormats
MsgBox(oFormat)
Next
End If
Catch oEx As Exception
MsgBox("GetOutputFormats failed." & vbCrLf & _
"Error Message is as follows:" & vbCrLf & _
oEx.Message & vbCrLf & vbCrLf & _
"Error Source is as follows:" & vbCrLf & _
oEx.Source & vbCrLf & vbCrLf & _
"Error StackTrace is as follows:" & vbCrLf & _
oEx.StackTrace & vbCrLf & vbCrLf & _
"Error Type.ToString is as follows:" & vbCrLf & _
oEx.GetType.ToString, vbOKOnly + vbInformation, " ")
End Try
End If
End Sub
Wesley Crihfield
(Not an Autodesk Employee)