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

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

EESignature

(Not an Autodesk Employee)