Message 1 of 2
Find Sheet Metal Part in Assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys
I have the 1st rule that returns the type of file. this works great
but the 2nd rule can't find the sheet metal part. It only recognizes it as a part. I know its because of the line is looking at the Assembly doc and not the sheet metal part
"SyntaxEditor Code Snippet
If ThisApplication.ActiveDocument.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" = True Then
But I'm not sure how to change this.
Donald
Inventor 2014
Rule 1
SyntaxEditor Code Snippet
Dim doc As Document = ThisDoc.Document If doc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject Then 'Drawing File MessageBox.Show("Drawing", "Title") Else If doc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then 'Part & Sheet Metal File If ThisApplication.ActiveDocument.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" = True Then 'Sheet Metal File MessageBox.Show("Sheet Metal", "Title") Else 'Part File MessageBox.Show("Part", "Title") End If Else If doc.DocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then 'Assembly File MessageBox.Show("Assembly", "Title") End If iLogicVb.UpdateWhenDone = True
Rule 2
SyntaxEditor Code Snippet
Dim doc As Document = ThisDoc.Document Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Iterate through all Of the occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef) If oOccurrence.DefinitionDocumentType = kDrawingDocumentObject Then MessageBox.Show("Drawing", "Title") Else If oOccurrence.DefinitionDocumentType = kPartDocumentObject Then If ThisApplication.ActiveDocument.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" = True Then MessageBox.Show("Sheet Metal", "Title") Else MessageBox.Show("Part", "Title") End If Else If oOccurrence.DefinitionDocumentType = kAssemblyDocumentObject Then End If Next InventorVb.DocumentUpdate()