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

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

nathaniel_dickerson
Explorer Explorer
1,954 Views
5 Replies
Message 1 of 6

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

nathaniel_dickerson
Explorer
Explorer

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

0 Likes
Accepted solutions (2)
1,955 Views
5 Replies
Replies (5)
Message 2 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@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



0 Likes
Message 3 of 6

philip1009
Advisor
Advisor

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.

0 Likes
Message 4 of 6

nathaniel_dickerson
Explorer
Explorer
Accepted solution

@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

 

0 Likes
Message 5 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

@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



0 Likes
Message 6 of 6

shastu
Advisor
Advisor

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.

0 Likes