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

Hi, you can do that using the CommandManager like so:

 

VBA:

'~~~~~Get the Part document~~~~~
Dim oDoc As Inventor.PartDocument
Set oDoc = ThisApplication.ActiveEditDocument

'~~~~~Get the Extrude feature~~~~~
Dim oFeature As Inventor.PartFeature
Set oFeature = oDoc.ComponentDefinition.Features.ExtrudeFeatures(1)

'~~~~~Select and edit extrude feature~~~~~~
oDoc.SelectSet.Clear
oDoc.SelectSet.Select oFeature

Dim oControlDef As Inventor.ControlDefinition
Set oControlDef = ThisApplication.CommandManager.ControlDefinitions("EditExtrudeCtxCmd")
oControlDef.Execute

iLogic:

'~~~~~Get the Part document~~~~~
Dim oDoc As Inventor.PartDocument = ThisDoc.Document

'~~~~~Get the Extrude feature~~~~~
Dim oFeature As Inventor.PartFeature = oDoc.ComponentDefinition.Features.ExtrudeFeatures(1)

'~~~~~Select and edit extrude feature~~~~~~
oDoc.SelectSet.Clear
oDoc.SelectSet.Select(oFeature)

Dim oControlDef As Inventor.ControlDefinition = ThisApplication.CommandManager.ControlDefinitions("EditExtrudeCtxCmd")
oControlDef.Execute

Tailor as necessary to work with your existing code and get the appropriate Extrude feature.