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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Creating Parameters with drop-down lists

ngoutis
6-Contributor

Creating Parameters with drop-down lists

I recently discovered that Creo automatically creates a Parameter titled "PTC_MATERIAL_NAME" whenever a material is assigned to a model. What I found interesting was that if multiple materials exist in the model, this Parameter allows the user to select from these materials in a drop-down list in the Parameters dialog box. This can be quite helpful for my organization because I can quickly map this "PTC_MATERIAL_NAME" parameter into Windchill, aiding in BOM creation.

My question is this: does anyone know how Creo automatically creates this "PTC_MATERIAL_NAME" parameter based on materials in the model? My work often requires the use of optional materials. What I am trying to do is create a Parameter titled something like "OPT_MATERIAL_NAME" that would function just like "PTC_MATERIAL_NAME" in that a user could select from a drop-down list of materials in the model. I could then map this optional material parameter into Windchill as well.

I've encountered a number of previous posts regarding creation of drop-down lists in parameters, all of which require an extensive amount of work creating a *.lst file. I'm hoping to avoid all of this. I'm hoping that there is a quick way to create a clone of the "PTC_MATERIAL_NAME" parameter.

If anyone has any insight on this matter, please respond! If other users have encountered similar problems, or have other methods of creating parameters based on material files, I'd like to hear from you as well.

3 REPLIES 3
Gucio
14-Alexandrite
(To:ngoutis)

As far as I know, the only way to achieve it is restricted value parameter - in other words, you have to create file *.txt.

regards,

gucio

Krzysztof
gage
4-Participant
(To:ngoutis)

ND_ParamDefArr_K01 = {
{Name=Material
Type=string
Default='HR'
Enum={'2BRSS','2BSS','304SS','316SS','430-2B','430-SS','AL','CR','EXP-SS','GAVL','HR','MAS','MS','PG','PWF','REV-SS','RIMEX-CR','RL','SM','SOLS','SS','SS-DP','SS-UP','SW'}
} /*  <you can repeat the above block for more parameters with a comma (,) here. example: ( }, ) */

 

this is the best i 've got so far. 

save it as a text file, put the following in your configure.pro "restricted_val_definition (file path to the text doc)"

then create the a parameter that matches the name in the text doc. in this case it the parameter name would be Material. when entering the name in the new parameter hit enter instead of clicking anything and it should auto fill and start with a default of SS. (the best place for the text doc is in a sub folder of your 'start in' directorie )

 

this is very syntax sensitive; be very deliberate in the changes you make becuase the best error code you will get is "such in such didn't load because of format error" in this this case go back and check the syntax is consistent with the example. there are more examples if you search for the syntax specifically 

 

I'm doing a similar thing but if anyone know how to setup the above for PTC_MATERIAL_NAME that what be vary useful

gage
4-Participant
(To:gage)

correction, the defualt will be HR

Top Tags