Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: JoãoASilva

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

EESignature

(Not an Autodesk Employee)