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

Hi @ramji.m.  There is an example of this in the earlier post.  It is a method defined under the CommandManager called 'Pick'.  It is a very popular tool that a lot of folks use that will pause your iLogic rule and wait for you to either manually select something in your model window, or cancel (Esc) out of the command.  Then the iLogic rule will continue with any code below that point in the rule.  It uses the SelectionFilterEnum, to allow you to specify/set which types of objects you want to select, and you can also specify a prompt message that will appear either next to your pointer or in the status bar, while you are in that manual selection mode.  You can use it to return your selected item to a variable within your rule, to you can work with that object through that variable.  It is common practice to use some code following this line in your rule, that makes sure you have selected something (in case you canceled the selection without selecting anything).  It may also be necessary to define that variable ahead of time as the type of object you are expecting, or check what type of object it is afterwards then create that type of variable then set the object as its value.  Once that variable's type is set right, you can access that variable's available properties, methods, events, etc.

Dim oOcc As ComponentOccurrence
oOcc = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "'Select an assembly occurrence.")
If oOcc Is Nothing Then
	MsgBox("You did not select anything. Exiting.", , "")
	Exit Sub
Else
	MsgBox("You selected an assembly occurrrence named '" & oOcc.Name & "'.",,"")
End If

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) :thumbs_up:.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)