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

I think you need to change this line:

Dim smDef As SheetMetalComponentDefinition = ThisDoc.Document.ComponentDefinition

Because with the new rule "ThisDoc.Document" is a drawing document.  You should be accessing your "oPart" Object:

Dim smDef As SheetMetalComponentDefinition = oPart.ComponentDefinition

But you will probably want to verify the "oPart" from the view is a sheet metal part or the above line will fail.