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: Chris.Brough

Hi @Chris.Brough .

If you have an assembly open and active when the code starts, no matter if you're in-place-editing a part within the main assembly, the assembly is still the active document environment to the code.  And Sculpt is only available at the Part modeling level.

So, to access that feature tool from an open assembly, you would have to first dig down through the object structure to the Part Document.  There's a few ways of doing that.  You could have the program pause to let you manually select the part within the assembly, or you could select it by name from the group of already open documents within Inventor, or you could select it by name through the ComponentOccurrences.

If you go the Occurrences route, you then get the Component's Definition.  Then define it as a PartComponentDefinition.  Then down to it's Features (or PartFeatures).  Then down to SculptFeatures.  Then SculptFeatures.Add(fill in the options).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)