08-21-2018
01:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-21-2018
01:53 PM
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 Is = 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 Is = 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 Is = 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 Id = DocumentTypeEnum.kAssemblyDocumentObject
MsgBody = "Assy Drawing File"
If CompDef.IsiPartFactory Then MsgBody = "Multi-config Assy drawing Factory"
If CompDef.IsiPartMember Then MsgBody = "Multi-config Assy drawing Member"
End Select
End If
Case Is = 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 Sub
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State
Custom Glyph Icon for iMates
Mass Override for Each Model State
Custom Glyph Icon for iMates