Skip to main content
14-Alexandrite
November 21, 2013
Solved

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

  • November 21, 2013
  • 4 replies
  • 21985 views

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

Best answer by Jose_Costa

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.

4 replies

17-Peridot
November 21, 2013

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

For example;

Lance

17-Peridot
November 21, 2013

See attached image.

parameter.jpg

14-Alexandrite
November 21, 2013

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.

12-Amethyst
November 21, 2013

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.

1-Visitor
November 22, 2013

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 = {

1-Visitor
November 22, 2013

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

1-Visitor
June 29, 2015

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

24-Ruby III
June 29, 2015

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

1-Visitor
June 29, 2015

Martin, thanks a lot.

1-Visitor
July 1, 2015

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.