cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

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

AndyHermanson
12-Amethyst

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

31 REPLIES 31

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

For example;

Lance

llie
16-Pearl
(To:llie)

See attached image.

parameter.jpg

AndyHermanson
12-Amethyst
(To:llie)

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.

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.

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

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

Jose,

This is what i was looking for. Here is a link to the PTC Site.

https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS121507&posno=5&q=add

James i have gotten this link to work. Follow the directions on the link. If you have further questions let me know.

Thanks again for the help Jose.

Thanks for the link Andy that was really helpful.

bduncan
15-Moonstone
(To:Jose_Costa)

RT.jpgIt seems not working.

James62
10-Marble
(To:bduncan)

The restricted params file needs to have a LST extension instead of TXT.

Jose_Costa
6-Contributor
(To:James62)

The examples come with LST extension, but I changed mine to TXT and works fine.

Creo+Parametric+Options.png

Jose_Costa
6-Contributor
(To:bduncan)

It´s very easy to damage that files, I believe that is what is happening to you

because has happened to me a lot of times . You have to be very careful editing it.

Check this:

http://communities.ptc.com/message/15294#15294

Jose

Ah, Ok. I remember being told by support that it needs to be a LST file. It's definitely good to know it can be changed to TXT extension, because Creo sometimes generates LST files for other purposes, which is kind of confusing.

Too bad I haven't had a time to play with this, but my guess is that you need to get a check mark in the Restricted column as is missing on following picture.

param.JPG

@Jose, about damaging of files, you're right. PDF files, and propably also the forums mess up with formating of the text, which is propably the cause of the file to fail to load properly. Would you be willing to post an example TXT file that works?

Jose_Costa
6-Contributor
(To:James62)

Have you tried the previous links on this thread ?

https://www.ptc.com/appserver/cs/view/solution.jsp?n=CS121507&posno=5&q=add

http://communities.ptc.com/message/15294#15294

Just change the extension to TXT.

Don´t use wordpad for editing this files, notepad is better, or maybe notepad++.

Jose

spete
5-Regular Member
(To:Jose_Costa)

Is there a way to update the restricted value file and have the parameters update, without having to delete and recreate them? Perhaps a way to read the values from a file each time its loaded?

BenLoosli
23-Emerald II
(To:spete)

The restricted params file is read each time you start Creo. If you make changes to the restricted params file, and you are modifying an existing Creo file, you need to go to tools- parameters and update the values in your Creo file. You will then see the latest parameter values.

TomU
23-Emerald IV
(To:spete)

As Ben mentioned, the restricted parameters file is read during startup, and you can use "tools, parameters, tools, update restriction definition" to force the current model to update it's cached list to agree with the current values in the params file. A couple of things to keep in mind:

  • The values in the params list are permanently stored in each model at the time the parameter is created, but only for the parameters actually present in the model.
  • The parameter file is not required any more after a model has been created. That model will continue to follow the restrictions that were present when the parameters were originally created.
  • Changes made to the restricted parameters list will NOT affect any existing models that already have those parameters present, unless they are manually updated (tool, parameters, tool, update restriction definition.)

I find restricted parameters most useful for custom library/start parts where I want to control the values for one very specific characteristic. This method only requires that I build a customized parameters list while I'm building the model. The rest of the users in the company don't have or need to have any restricted parameters list.

spete
5-Regular Member
(To:TomU)

Thanks Ben and Tom! The info you presented will be helpful to me.

One question I have - in order to update a restricted parameter, does one need to have the restricted paramter file read? I have a list of vendors in a dropdown list that is used with a start part to allow the users to select the vendor instead of entering it in manually. Occasionally a new vendor is added, but I am only informed when the user wants to add it to the part that was created with the old list. Would that user need to have the RP file read into session to update the parameter once I have updated the file?

TomU
23-Emerald IV
(To:spete)

Yes, the file has to be present during startup. If you make changes to the file you have to shut down and relaunch Creo. If you intend to share this with all your users then I'd recommend you set the path to the file to some read-only shared path. That way any time you make changes to the file the users will automatically be reading the latest version the next time they startup.

spete
5-Regular Member
(To:TomU)

I planned on keeping the start parts updated, unfortunately, as I stated, users rarely think ahead and have already created the part they need the new vendor info for. But its good to know that I don't have to keep deleting and recreating the parameter each time I update.

BenLoosli
23-Emerald II
(To:spete)

You should update any start parts or templates whenever you make changes to the restricted params file so your seed parts are up-to-date.

We use the file for names of people signing off on drawings, so my list changes every few months. After a couple of changes I go in and update the drawing template files so the designers have the latest lists in all new files.

spete
5-Regular Member
(To:BenLoosli)

I have all the company configuration, template, and other such files in a limited access folder structure (or at least it will be once I sit down with the IT department.

I am also using the restrictedparams.txt file and it works very nicely.  However, I have a cascade parameters effect that I need to manage.  Any workaround is much appreciated.

 

I.E>,

PART_TYPE  =  A

PART_SUBCLASS :

*A1

*A 2

*A 3

PART_TYPE  =  B

PART_SUBCLASS :

*B1

*B 2

*B 3

 

cying
10-Marble
(To:cying)

I have a similar need for cascading restricted parameters.  This would be GREAT for an enhancement (Hint hint PTC).  You can do this in Windchill but not in CREO 4. 

 

There's a way to do this in ModelCHECK check but will take a lot of tricky configuration to make this happen. 

 

This should be an OOTB functionality.  Solidwork does this today and a few automations that should be easy to implement. 

JADEN_9797
4-Participant
(To:Jose_Costa)

Not sure if it was just me but I found the above didn't work. 

This is my working code;

ND_ParamDefArr_K01 = {

{ Name = left_end
Type = string
Default = 'END_STOP'
Enum = { 'SPLICE', 'END_STOP', 'FSE', 'NONE' }
},

{ Name = RIGHT_END
Type = string
Default = 'END_STOP'
Enum = { 'SPLICE', 'END_STOP', 'FSE', 'NONE' }
}
!!! ADD MORE RESTRICTED VALUE PARAMS HERE, PLACE A , BEHIND THE ABOVE }
}

 

In my Config.Pro file I have;

restricted_val_definition C:\PTC_CAD_Support\CONFIG_FILES\CREO2\restricted_parameters.lst

 

As one of the other provided links seem to no longer work, I found this youtube video very helpful: https://www.youtube.com/watch?v=p8_HoUPT_F8

TomU
23-Emerald IV
(To:JADEN_9797)

These things haven't changed in forever.  There is a whole section in the help documentation on them:

http://support.ptc.com/help/creo/creo_pma/usascii/#page/fundamentals%2Ffundamentals%2Ffund_seven_sub%2Fabout_Restricted_Value_Parameters.html%23

is looks correct to me, just like scripting, you need to make sure you have the match open "{" with the close "}" and commas.

 

Good luck!

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

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


Martin Hanák
Top Tags