10-07-2020
06:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-07-2020
06:06 AM
Maybe try it this way:
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oPDoc As PartDocument
Dim oSMDef As SheetMetalComponentDefinition
Dim oSMFeats As SheetMetalFeatures
For Each oSheet As Inventor.Sheet In oDDoc.Sheets
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
Next
Wesley Crihfield
(Not an Autodesk Employee)