Using 'Continue' instead of 'ESC' when object selection is complete

Using 'Continue' instead of 'ESC' when object selection is complete

JBerns
Advisor Advisor
2,577 Views
8 Replies
Message 1 of 9

Using 'Continue' instead of 'ESC' when object selection is complete

JBerns
Advisor
Advisor

Community,

 

Several Inventor sketch, part, assembly, and drawing commands require you to select objects before continuing the command.

 

In this image, the Mirror command is executing. When you are done selecting objects you can right-click (RMB) and select Continue from the marking menu. You can also use a mouse gesture.

2020-04-30_12-26-12.png

This is easier than having to return to the dialog box to advance to the next step of the command process.

 

Currently, iLogic requires the user to press ESC when using a selection method/command for selecting objects. Is it possible to leverage this 'Continue' functionality? For examples, refer to commands such as sketch mirror, part mirror, drawing ordinate dimension, etc.?

 

I think this would be more intuitive to 'continue' your iLogic rule rather than pressing ESC.

 

If this is available through the API, I would welcome feedback on how to use it. If not, I would welcome your vote to encourage Autodesk to add this functionality to the API.

 

Thank you for your time and attention. I look forward to your replies.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor Certified Professional
Autodesk AutoCAD Certified Professional
0 Likes
Accepted solutions (1)
2,578 Views
8 Replies
Replies (8)
Message 2 of 9

WCrihfield
Mentor
Mentor

Perhaps one of these Commands would do the trick:

AppContextual_ApplyCmd

AppContextual_ContinueCmd

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 9

JBerns
Advisor
Advisor

@WCrihfield,

 

Looks quite complicated to implement at this time in an iLogic rule.

I hope this may be made simpler to leverage in a future version.

 

Thanks for the info and quick reply. I searched the Inv 2019 API help (188 hits for 'continue')

 

There is no help listed for the commands you mentioned. How did you discover those?

 

Thanks again.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor Certified Professional
Autodesk AutoCAD Certified Professional
0 Likes
Message 4 of 9

WCrihfield
Mentor
Mentor

Threre are several ways to get a list of all available commands.  I have saved a couple versions of this list off locally, for quick reference.

VBA version

 

 

Sub PrintCommandNames()
    Dim oControlDefs As ControlDefinitions
    Set oControlDefs = ThisApplication.CommandManager.ControlDefinitions

    Dim oControlDef As ControlDefinition
    
    Open "C:\temp\CommandNames.txt" For Output As #1

    Print #1, Tab(10); "Command Name"; Tab(75); "Description"; vbNewLine
    
    For Each oControlDef In oControlDefs

        Print #1, oControlDef.InternalName; Tab(55); oControlDef.DescriptionText
        
    Next
    Close #1
End Sub

 

 

More informational iLogic version

 

 

Dim oCDs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions
Dim oCD As ControlDefinition
Dim oFileName As String = "C:\Temp\List Of All Commands.txt"

Try
	oWrite = IO.File.CreateText(oFileName)
	For Each oCD In oCDs
		oWrite.WriteLine("DisplayName = " & oCD.DisplayName)
		oWrite.WriteLine("InternalName = " & oCD.InternalName)
		oWrite.WriteLine("ClientId = " & oCD.ClientId)
		oWrite.WriteLine("DefinitionType.ToString = " & oCD.DefinitionType.ToString)
		oWrite.WriteLine("DescriptionText = " & oCD.DescriptionText)
		oWrite.WriteLine("Enabled.ToString = " & oCD.Enabled.ToString)
		oWrite.WriteLine("ToolTipText = " & oCD.ToolTipText)
		oWrite.WriteLine("ProgressiveToolTip.Description = " & oCD.ProgressiveToolTip.Description)
		oWrite.WriteLine("BuiltIn.ToString = " & oCD.BuiltIn.ToString)
		oWrite.WriteLine("DefaultShortcut = " & oCD.DefaultShortcut)
		oWrite.WriteLine("DefaultShortcutType.ToString = " & oCD.DefaultShortcutType.ToString)
		oWrite.WriteLine("IsShortcutOverridden.ToString = " & oCD.IsShortcutOverridden.ToString)
		oWrite.WriteLine("OverrideShortcut = " & oCD.OverrideShortcut)
		oWrite.WriteLine("OverrideShortcutType.ToString = " & oCD.OverrideShortcutType.ToString)
		oWrite.WriteLine("IntroducedInVersion = " & oCD.IntroducedInVersion)
		oWrite.WriteLine("LastUpdatedVersion = " & oCD.LastUpdatedVersion)
		oWrite.WriteLine("")
		oWrite.WriteLine("")
	Next
Catch
End Try
oWrite.Close()
ThisDoc.Launch(oFileName)

 

 

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • MessageBox, InputBox, and InputListBox Size & Format Options Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
  • Create DocumentSubTypeEnum Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum |

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 9

WCrihfield
Mentor
Mentor

@JBerns 

I likely got most of the VBA version code from an API sample program (in the online help area), maybe a 1 to 1.5 years ago.

The iLogic code is all me, but using the technique shown under iLogic Rule Editor dialog box / Snippets / Custom tab / "My Snippets" / Text File Create.

This simple, yet very effective technique has proved extremely usefull over the years, in researching, devoloping quick references / and more intuitively coding.

There are, of course, techniques for creating and writing to a new Excel file too, that can be very helpful for similar purposes.  What's nice about the Excel techniques though, is that they then can be used in other ways to make your code smarter down the road.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 9

WCrihfield
Mentor
Mentor

Here is another similar iLogic tool I often use to search the other direction.  If I know what topic or main idea I'm searching for, and want to see if there may be a command I can use; or if I want to further customize a button definition, etc.

There are a couple of options I have commented out to allow a quick change in the search type.

 

Dim oShortCutType As ShortcutTypeEnum
Dim oDefType As ControlDefinitionTypeEnum
Dim oLargeIcon As IPictureDisp
Dim oStandardIcon As IPictureDisp

For Each oContDef As ControlDefinition In ThisApplication.CommandManager.ControlDefinitions
'For Each oComCat As CommandCategory In ThisApplication.CommandManager.CommandCategories
	If oContDef.DisplayName.Contains("Ground") Then
'	If oContDef.InternalName = "PartNGxHoleEditCtxCmd" Then
	'If oContDef.DisplayName = "" Then
		oShortCutType = oContDef.DefaultShortcutType
		oDefType = oContDef.DefinitionType
'		oLargeIcon = oContDef.LargeIcon
'		oStandardIcon = oContDef.StandardIcon
 		MessageBox.Show("The ControlDefinition DisplayName is: " & oContDef.DisplayName & vbNewLine &
		"Built In? = " & oContDef.BuiltIn & vbNewLine &
		"Default Shortcut = " & oContDef.DefaultShortcut & vbNewLine &
		"Default Shortcut Type Enum = " & oShortCutType.ToString & vbNewLine &
		"Definition Type = " & oDefType.ToString & vbNewLine &
		"Description Text = " & oContDef.DescriptionText & vbNewLine &
		"Enabled = " & oContDef.Enabled & vbNewLine &
		"ClientID = " & oContDef.ClientId & vbNewLine &
		"Classification = " & oContDef.Classification.ToString & vbNewLine &
		"Internal Name = " & oContDef.InternalName & vbNewLine &
		"Introduced in Version = " & oContDef.IntroducedInVersion & vbNewLine &
		"Last Updated Version = " & oContDef.LastUpdatedVersion & vbNewLine &
		"Is default Shortcut Overridden? = " & oContDef.IsShortcutOverridden.ToString & vbNewLine &
		"If Default Shortcut is Overridden :" & vbNewLine &
		"Override Shortcut = " & oContDef.OverrideShortcut & vbNewLine &
		"Overridden Shortcut Type = " & oContDef.OverrideShortcutType & vbNewLine &
		"Tool Tip Text = " & oContDef.ToolTipText, "ControlDefinition INFO")
		'oContDef.Execute
		'oContDef.AutoAddToGUI
	End If
Next

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 9

JBerns
Advisor
Advisor

@WCrihfield,

 

Thank you. Those will be useful tools I hope to leverage some day when I advance from iLogic rules to Add-ins.

 

Kind regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor Certified Professional
Autodesk AutoCAD Certified Professional
0 Likes
Message 8 of 9

JhoelForshav
Mentor
Mentor
Accepted solution

@JBerns 

Try this iLogic rule as an example of how you can modify your radial menu:

 

Class ThisRule
	Private WithEvents mUserInputEvents As UserInputEvents
	Sub Main
		Dim oCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
		mUserInputEvents = ThisApplication.CommandManager.UserInputEvents
		While True
			oSelFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "pick face.")
			If oSelFace Is Nothing Then Exit While
			oCol.Add(oSelFace)
		End While
		mUserInputEvents = Nothing
		MsgBox("You have selected " & oCol.Count & " faces")
	End Sub
	Sub modifyRadialMenu(ByVal SelectedEntities As Inventor.ObjectsEnumerator, ByVal SelectionDevice As Inventor.SelectionDeviceEnum, ByVal RadialMenu As Inventor.RadialMarkingMenu, ByVal AdditionalInfo As Inventor.NameValueMap)Handles mUserInputEvents.OnRadialMarkingMenu
		RadialMenu.EastControl = ThisApplication.CommandManager.ControlDefinitions.Item("AppContinueCmd")
	End Sub
End Class

 

Run the rule in a part document. The rule lets you pick multiple planar faces and adds them to an object collection. When you're done picking you can right-click and click continue. The code then continues to run and gives a messagebox telling you how many faces are in the collection.

 

Message 9 of 9

JBerns
Advisor
Advisor

@JhoelForshav,

 

Brilliant! Exactly what I was looking for and so easy to implement.

 

The Inventor Community is awesome! Thank you so much, Jhoel!

 

 

Kind regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor Certified Professional
Autodesk AutoCAD Certified Professional