Can you create a drop down list for parameters in Creo?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
-
General
- Tags:
- parameters
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Are you asking for a drop down list for specific parameters in the parametr UI?
For example;
Lance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
See attached image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 = {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If they already exists you have to delet it and create them restrictly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for the link Andy that was really helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It seems not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The restricted params file needs to have a LST extension instead of TXT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The examples come with LST extension, but I changed mine to TXT and works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
@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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
These things haven't changed in forever. There is a whole section in the help documentation on them:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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