10-07-2020
06:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-07-2020
06:30 AM
OK. Try this then.
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oPDoc As PartDocument
Dim oSMDef As SheetMetalComponentDefinition
Dim oSMFeats As SheetMetalFeatures
If oSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocumentType = DocumentTypeEnum.kPartDocumentObject Then
oPDoc = oSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
If oPDoc.PropertySets.Item("Design Tracking Properties").Item("Document SubType Name").Value = "Sheet Metal" Then
oSMDef = oPDoc.ComponentDefinition
oSMFeats = oSMDef.Features
If oSMFeats.FlangeFeatures.Count > 0 Or _
oSMFeats.ContourFlangeFeatures.Count > 0 Or _
oSMFeats.HemFeatures.Count > 0 Or _
oSMFeats.FoldFeatures.Count > 0 Then
oPDoc.PropertySets.Item("Inventor Summary Information").Item("Comments").Value = "Laser Cut + Bending"
End If
Else 'it's a regular part (not sheet metal)
oPDoc.PropertySets.Item("Inventor Summary Information").Item("Comments").Value = "Laser Cut"
End If
'Else ' the model in the drawing view is not a part document, so do nothing, then next.
End If
Wesley Crihfield
(Not an Autodesk Employee)