02-18-2019
12:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-18-2019
12:45 PM
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.