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: 

Toggle between normal and multi value parameter

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
toon.sol
312 Views, 2 Replies

Toggle between normal and multi value parameter

Hello,

 

I'm working on a part that is being controlled by a form.

In this form I can choose between type 1 and type 2.

Type 1 has a given width dimensjons (from a list)

Type 2 can be any width you want.

 

What I would like to do now is using the type (1 or 2) to toggle between a multi value list and a normal parameter.

It could happen that I would jump back from 1 to 2 or from 2 to 1.

 

I was thinking like this:

 

if type = "1" then

    MultiValue.SetList ("width", 600,700)

else if type = "2" then

   "" and here I don't know. I would like to "remove" the list and just have the current value

End if

 

Any suggestions are welcome.

 

Thanks Toon

 

 

 

 

  

 
MultiValue.SetList("trinn_brede", 600, 700)

 

 

2 REPLIES 2
Message 2 of 3
A.Acheson
in reply to: toon.sol

Hi @toon.sol 

You won't be able to change the parameter style of the form on the fly but you could have a multivalue list with a custom value. If you overwrite the parameter this value will stick. If you select the value from the list it will dissappear. Just set the parameter to custom in the parameters box. 

 

This video shows the process

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 3

Hi @toon.sol 

 

Create your multivalue parameter with a list, and then add it to the form. This way the form has a drop down list.

 

Then use something like this to set the list based on the value of the parameter called type

 

The line "MultiValue.SetValueOptions(True, DefaultIndex := 0)" tells the parameter to reset the first item in the list, when the current value of that parameter is not in the list.

 

MultiValue.SetValueOptions(True, DefaultIndex := 0)

If type = "1" Then
	MultiValue.SetList("width", 600, 700)
ElseIf type = "2" Then
	MultiValue.SetList("width", Parameter("width"))
End If

 

You might also want to set the "Allow Custom Values" option for the list.

Curtis_Waguespack_1-1688592097768.png

 

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

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

Post to forums  

Autodesk Design & Make Report