To Select Multiple Items from a Drop-Down list

To Select Multiple Items from a Drop-Down list

RoyWickrama_RWEI
Advisor Advisor
1,832 Views
4 Replies
Message 1 of 5

To Select Multiple Items from a Drop-Down list

RoyWickrama_RWEI
Advisor
Advisor

I came across with another need of a iLogic rule.

For me, this is complex and unable to figure out how to do this. Please see below.

Multiple2.png

 

Could some one help me.

 

0 Likes
Accepted solutions (1)
1,833 Views
4 Replies
Replies (4)
Message 2 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@RoyWickrama_RWEI,

 

Try below iLogic code for multiple selection and listing in an array. Initially, need to select items from multiple pop out of input window. After closing input window, selected items are displayed.

 

Dim oTypes_Array As New ArrayList 
oTypes_Array.Add("Paint code")
oTypes_Array.Add("Paint code 2")
oTypes_Array.Add("PART COMMENTS")
oTypes_Array.Add("Completion Date")
oTypes_Array.Add("Exit")
Dim oSelected As New ArrayList 

While True 
	oTypes_Selected = InputListBox("SELECT TYPE:", oTypes_Array, oTypes_Array(0), oRuleNo, X_oProp_Array)
	If IsNothing (oTypes_Selected) Then Exit While 
	oSelected.Add(oTypes_Selected)	
End While 

If oSelected.Count > 0 Then
	For Each oText In oSelected 
		MessageBox.Show(oText, "Selected items")
	Next
End If

Please feel free to contact if there is any queries.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 3 of 5

RoyWickrama_RWEI
Advisor
Advisor

@chandra.shekar.g wrote:

@RoyWickrama_RWEI,

 

Try below iLogic code for multiple selection and listing in an array. Initially, need to select items from multiple pop out of input window. After closing input window, selected items are displayed.

 

Dim oTypes_Array As New ArrayList 
oTypes_Array.Add("Paint code")
oTypes_Array.Add("Paint code 2")
oTypes_Array.Add("PART COMMENTS")
oTypes_Array.Add("Completion Date")
oTypes_Array.Add("Exit")
Dim oSelected As New ArrayList 

While True 
	oTypes_Selected = InputListBox("SELECT TYPE:", oTypes_Array, oTypes_Array(0), oRuleNo, X_oProp_Array)
	If IsNothing (oTypes_Selected) Then Exit While 
	oSelected.Add(oTypes_Selected)	
End While 

If oSelected.Count > 0 Then
	For Each oText In oSelected 
		MessageBox.Show(oText, "Selected items")
	Next
End If

Please feel free to contact if there is any queries.

 

Thanks and regards,


 

 

Thanks a lot.

It is a great piece of coding helped me to tailor to reach my needs. I just created (assembled) a sample rule for deleting multiple iProperties. Need to improve to delete iProperties in the model document from within drawing document.

0 Likes
Message 4 of 5

RoyWickrama_RWEI
Advisor
Advisor

@RoyWickrama_RWEI wrote:

@chandra.shekar.g wrote:

@RoyWickrama_RWEI,

 

Try below iLogic code for multiple selection and listing in an array. Initially, need to select items from multiple pop out of input window. After closing input window, selected items are displayed.

 

Dim oTypes_Array As New ArrayList 
oTypes_Array.Add("Paint code")
oTypes_Array.Add("Paint code 2")
oTypes_Array.Add("PART COMMENTS")
oTypes_Array.Add("Completion Date")
oTypes_Array.Add("Exit")
Dim oSelected As New ArrayList 

While True 
	oTypes_Selected = InputListBox("SELECT TYPE:", oTypes_Array, oTypes_Array(0), oRuleNo, X_oProp_Array)
	If IsNothing (oTypes_Selected) Then Exit While 
	oSelected.Add(oTypes_Selected)	
End While 

If oSelected.Count > 0 Then
	For Each oText In oSelected 
		MessageBox.Show(oText, "Selected items")
	Next
End If

Please feel free to contact if there is any queries.

 

Thanks and regards,


 

 

Thanks a lot.

It is a great piece of coding helped me to tailor to reach my needs. I just created (assembled) a sample rule for deleting multiple iProperties. Need to improve to delete iProperties in the model document from within drawing document.


 

 

Revised to delete iProperties in Parts, Assemblies, Drawings and model document of the drawing (from within drawing).

0 Likes
Message 5 of 5

Anonymous
Not applicable

Thank you for asking this question as I have been driving myself nuts trying to figure this out. 

Using this code, is there a way to highlight each selection or maybe even have a checkbox next to each item so that i could just check each selection i want???

Also I'm wanting the selection window to appear once, make my selection(s) and have the display box appear once afterward. 

 

Ultimately, I'm trying to add/remove/move sketches/extrusions on a model based off the selection i choose.

I design electrical transformers and i'm trying to create an ilogic to quickly model my coil based off of user input.

 

For example, I'm designing the model of a coil with up to 5 layers of conductor winding. Within those five layers i want to put 2 spaces for cooling between layers 2-3 & 3-4 which means i want no space for cooling between layers   1-2 & 4-5. I have a form already created to allow me to choose (1.) the amount of layers in my coil & (2.) the amount of spaces for cooling in that coil. As soon as i choose the amount of spaces for cooling in the coil (in this case only 2), i want that message box to appear allowing me to make only two selections between 1-2, 2-3, 3-4, or 4-5 (in this case i would make the selection 2-3 & 3-4). My whole goal is that i want to choose what layers i can put those cooling spaces in. I have the airspaces modeled as cut extrusions so i'm hoping once i figure out how to do the user selection list, i can write another code to suppress different extruded features based on those selections i choose

 

I know this is a bit much and maybe hard for some to understand what i'm trying to do, but would appreciate if anyone could help or even give me an idea of how to do what i'm trying to accomplish. 

0 Likes