Skip to main content
Nov 21, 2013 4:13 PM UTC
Solved

Can you create a drop down list for parameters in Creo?

I am looking to see if there is a way to create drop down lists for user created parameters.

Example: If you assign multiple material files to a part in Creo you then get a drop down list of those material files.

I want to be able to do this with user/Admin create parameters. Anyone have any ideas?

Thanks in advance.

Andy

Nov 21, 2013 10:57 PM UTC

You can use a restriction definition file to do that:

First step: Create a new text file, you can copy this text and change it to meet your needs:

ND_ParamDefArr_K01 = {

{ Name = color_1

Type = string

Default = 'blue_new'

Enum = { 'red_new', 'green_new', 'blue_new' }

},

{ Name = color_2

Type = string

..Default = 'white_new'

..! DEFAULT IS WHITE_NEW

..Enum = { 'yellow_new', 'white_new', 'black_new' }

},

!!! ADD MORE RESTRICTED VALUE PARAMS HERE

}

This example has two parameters ("Color_1" and "Color_2") with three items.

Second step: Add this option to your config.pro:

restricted_val_definition c:\Creo_startin\rest_parameters.txt

Change the path to match your file.

31 replies

Nov 21, 2013 4:44 PM UTC

Are you asking for a drop down list for specific parameters in the parametr UI?

For example;

Lance

Nov 21, 2013 4:46 PM UTC

See attached image.

parameter.jpg

Nov 21, 2013 5:30 PM UTC

Yes. I want to have a parameter that has a known set of possible answers to have a drop down instead of having users manually typing them in.

Nov 21, 2013 10:57 PM UTC

You can use a restriction definition file to do that:

First step: Create a new text file, you can copy this text and change it to meet your needs:

ND_ParamDefArr_K01 = {

{ Name = color_1

Type = string

Default = 'blue_new'

Enum = { 'red_new', 'green_new', 'blue_new' }

},

{ Name = color_2

Type = string

..Default = 'white_new'

..! DEFAULT IS WHITE_NEW

..Enum = { 'yellow_new', 'white_new', 'black_new' }

},

!!! ADD MORE RESTRICTED VALUE PARAMS HERE

}

This example has two parameters ("Color_1" and "Color_2") with three items.

Second step: Add this option to your config.pro:

restricted_val_definition c:\Creo_startin\rest_parameters.txt

Change the path to match your file.

Nov 22, 2013 3:46 PM UTC

I tried doing this and I'm having trouble getting it to work. I am very computer stupid, so I could use some more details about how to make this work.

1. Do I need to create the parameters in the model, or will this create the parameters automatically?

2. Do I have to do anything in Creo to tell it to look at this text file, other then the config.pro option? Meaning, when a parameter with this "name" always have those options when created, or do I have to tell it to use those options?

3. What does the first line of that text mean?

ND_ParamDefArr_K01 = {

Nov 22, 2013 4:05 PM UTC

If they already exists you have to delet it and create them restrictly.

Jun 29, 2015 5:43 AM UTC

Hi Jose,

I tried to make two parameters with drop down list and modified the config.pro.

Unfortunatelly i cannot get it working.

Please see attached pic.

Thanks in advance

T.Screenshot_2.png

Jun 29, 2015 6:16 AM UTC

Tomas,

I uploaded my test restriction file list1.lst packed in list1.zip. I tested it in Creo 2.0.

config.pro option

restricted_val_definition D:\users\mh\creo2_parametric\list1.lst

Martin Hanak

Jun 29, 2015 6:40 AM UTC

Martin, thanks a lot.

Jul 1, 2015 2:43 PM UTC

I am working on implementing this for our material callouts and have it working with the exception of within family tables.

With the generic I can select one of the materials from the table I built following this

Table-Restricted Parameters

However when I make a family table the only option available is the one from the generic. Is there a way to have all of  the materials in my table available for the instances?

I am replying back to this thread because it is far more recent than the other one specifically for using tables.

Edit

I can get the parameter matl to the family table, however the parameter material the is driven in the table will not update. If I open the instances they show the correct material. If I write a relation of material_callout=material it updates correctly. What is going wrong. I have attached my parameter file and a screen show of the family table.