Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CommandManager.ControlDefinition.Item("EditHoleCtxCmd") Gone from 2019?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
nathaniel_dickerson
1812 Views, 5 Replies

CommandManager.ControlDefinition.Item("EditHoleCtxCmd") Gone from 2019?

It appears like EditHoleCtxCmd is not apart of the 2019 Command Manager Control Definitions. Has this been replaced by another command or will it come back again? If it has gone the way of the dodo for good is there an alternate method to launch the 2019 Edit Feature command for holes.

 

EditFeatureWrapperCmd appears to do nothing.

 

T.I.A.

Nathaniel

5 REPLIES 5
Message 2 of 6

@nathaniel_dickerson,

 

Try below VBA code to get hole edit dialog.

Sub Main()
Call CommandManager.ControlDefinition.Item("PartNGxHoleEditCtxCmd").Execute
End Sub

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 3 of 6

This might be from the Hole command being replaced in 2019, try looking under the What's New section of the API help to see if there's a command to use as a replacement.

Message 4 of 6

@chandra.shekar.g

 

That worked. Thank You

 

The PartNGxHoleEditCtxCmd works with the code below, what

does the NGx stand for ( NewGoodness Smiley Happy )? 

 

Without a description of what this command does it is really

hard to tell that this a way to call the Edit Hole, or Edit Feature

as it is called in the UI.

 

Any chance that a supplemental document with command

descriptions completed could be made or the API CHM

updated with this information?

 

Public Sub test_PartNGxHoleEditCtxCmd()

Dim pDoc As PartDocument
Set pDoc = ThisApplication.ActiveDocument

Dim hFeat As HoleFeature
Set hFeat = pDoc.ComponentDefinition.Features.HoleFeatures.Item(1)

pDoc.SelectSet.Select hFeat

Dim oCntrlDefs As ControlDefinitions
Set oCntrlDefs = ThisApplication.CommandManager.ControlDefinitions

Dim oControlDef As ControlDefinition
Set oControlDef = oCntrlDefs.Item("PartNGxHoleEditCtxCmd")

Call oControlDef.Execute

End Sub

 

Message 5 of 6

@nathaniel_dickerson,

 

After executing command through UI, run below VBA code to get active command name.

Sub PrintActiveCommandName()
    Debug.Print ThisApplication.CommandManager.ActiveCommand
End Sub 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 6 of 6

Due to the way that 2019 has changed the holes, I am needing a way to edit the holes that were created without a sketch in VBA without the dialog box ever showing.  In other words, I just need the hole to update.  It would be the equivalent of a RMC on the Hole feature, LMC on "Edit Feature" and then selecting the OK button in the dialog box that you have coming up in your code.  I don't change anything in the dialog box.  By just doing the edit and clicking on OK, it creates the sketch.  When my code runs I don't want to see the dialog box, but I want the hole to update to where it has a sketch.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report