08-22-2018
04:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-22-2018
04:12 AM
Got it - should be:
Sub Test()
Dim app As Application
Dim Doc As Document
Dim CompDef As ComponentDefinition
Dim MsgBody As String
Set app = ThisApplication
Set Doc = app.ActiveDocument
Select Case Doc.DocumentType
Case DocumentTypeEnum.kPartDocumentObject
MsgBody = "Part File"
Set CompDef = Doc.ComponentDefinition
If CompDef.IsiPartFactory Then MsgBody = "Multi-config Part Factory"
If CompDef.IsiPartMember Then MsgBody = "Multi-config Part Member"
Case DocumentTypeEnum.kDrawingDocumentObject
MsgBody = "Plain Drawing File"
Dim DocM As Document
If Doc.ReferencedDocuments.Count > 0 Then
Set DocM = Doc.ReferencedDocuments.Item(1)
Set CompDef = DocM.ComponentDefinition
Select Case DocM.DocumentType
Case DocumentTypeEnum.kPartDocumentObject
MsgBody = "Part Drawing File"
If CompDef.IsiPartFactory Then MsgBody = "Multi-config Part drawing Factory"
If CompDef.IsiPartMember Then MsgBody = "Multi-config Part drawing Member"
Case DocumentTypeEnum.kAssemblyDocumentObject
MsgBody = "Assy Drawing File"
If CompDef.IsiAssemblyFactory Then MsgBody = "Multi-config Assy drawing Factory"
If CompDef.IsiAssemblyMember Then MsgBody = "Multi-config Assy drawing Member"
End Select
End If
Case DocumentTypeEnum.kAssemblyDocumentObject
MsgBody = "Assy File"
Set CompDef = Doc.ComponentDefinition
If CompDef.IsiAssemblyFactory Then MsgBody = "Multi-config Assy Factory"
If CompDef.IsiAssemblyMember Then MsgBody = "Multi-config Assy Member"
End Select
MsgBox (MsgBody)
End SubAnyway solution is yours.. Thanks!
Please vote for Inventor-Idea Text Search within Option Names