Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I can't figure why the command is working or assembly iAssy but not for the part iPart. Below is the chunk of code to run them. I've attached example files I was using.
Dim Path As String = "C:\TEST\ExportTest"
Dim ExportFile As String = Path & ".xls"
Logger.Info("ExportFile " & ExportFile)
Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
Logger.Info("Assy FileType")
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
If oAsmDoc.ComponentDefinition.IsiAssemblyFactory = True Then
Logger.Info("Assy iAssemblyFactory Found")
Dim oiAssyFactory As iAssemblyFactory = oAsmDoc.ComponentDefinition.iAssemblyFactory
oiAssyFactory.Export(ExportFile, FileFormatEnum.kMicrosoftExcelFormat)
End If
End If
If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
Logger.Info("Part FileType")
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Logger.Info("oPartDoc")
If oPartDoc.ComponentDefinition.IsiPartFactory = True Then
Logger.Info("Part iPartFactory Found")
Dim oiPartFactory As iPartFactory = oPartDoc.ComponentDefinition.iPartFactory
oiPartFactory.Export(ExportFile, FileFormatEnum.kMicrosoftExcelFormat)
End If
End If
Solved! Go to Solution.