Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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.
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
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
correction, the defualt will be HR