Community
Hello!
Is there any way(ilogic/API ..etc.) to automatically place drawing sheet size into the BOM?
Or any drawing custom property to the BOM list
Example:
After creating drawing for part TT-07-02 with sheet size A3, the column "Sheet Size" after creation would fill up automatically.
Why would one want to show the sheet size in a BOM anyways? Seems like just extra useless information.
Sub Main() If Not ThisApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then MessageBox.Show("Current document is not drawing docuemnt", "Inventor") Exit Sub End If Dim value_List As List(Of String) = New List(Of String) value_List.Add(iProperties.Value("Custom", "Sheet Size")) Dim oDoc As Document oDoc = ThisDrawing.ModelDocument If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then Update_Properties(oDoc, value_List) Dim oAsyDoc As AssemblyDocument oAsyDoc = oDoc Dim oReferDoc As Document Dim occ As ComponentOccurrence Dim oDef As AssemblyComponentDefinition oDef = oAsyDoc.ComponentDefinition 'For Each occ In oDef.Occurrences 'If occ.SubOccurrences.Count = 0 Then 'oReferDoc = occ.ReferencedDocumentDescriptor.ReferencedDocument 'Update_Properties(oReferDoc, value_List) 'Else 'oReferDoc = occ.ReferencedDocumentDescriptor.ReferencedDocument 'Update_Properties(oReferDoc, value_List) 'processAllSubOcc(occ, value_List) 'End If 'Next Else If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then Update_Properties(oDoc, value_List) End If End Sub 'Private Sub processAllSubOcc(ByVal oCompOcc As ComponentOccurrence , value_List As List(Of String)) 'Dim oSubCompOcc As ComponentOccurrence 'Dim oReferDoc As Document 'For Each oSubCompOcc In oCompOcc.SubOccurrences 'If oSubCompOcc.SubOccurrences.Count = 0 Then 'oReferDoc = oSubCompOcc.ReferencedDocumentDescriptor.ReferencedDocument 'Update_Properties(oReferDoc,value_List) 'Else 'oReferDoc = oSubCompOcc.ReferencedDocumentDescriptor.ReferencedDocument 'Update_Properties(oReferDoc ,value_List) 'Call processAllSubOcc(oSubCompOcc, value_List) 'End If 'Next 'End Sub Sub Update_Properties(oDoc As Document, value_List As List(Of String)) oDoc.PropertySets.Item("Inventor User Defined Properties").Item("Sheet Size").Value = value_List.Item(0) oDoc.Save() End Sub
Thank you for attention!
Can't find what you're looking for? Ask the community or share your knowledge.