Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Is there a way when setting up my .start file and setting my parameters, that I can set one to autofill the file name, so I do not have to manually enter the part name everytime?
If you're referring to creating a parameter based on the filename, you can use the following relation:
*SET PART_NUMBER BASED ON MODEL NAME
part_number=rel_model_name()
If you use filenames like 123456789_bracket.prt, you can use a relation like:
part_number=extract(rel_model_name(),1,9)
This will extract just the first 9 characters of the filename.
Regards,
Dan N.
I am trying to add this parameter to a start.prt, but when I add this parameter it uses the start.prt filename, not the one of the new part I create using this start.prt/
Example:
sheetmetal_start.prt contains the parameter/relation part_number=extract(rel_model_name(),1,7)
Created new part 1234567.prt. In the parameters under part_number, it says "sheetme" instead of "1234567"
Since it's a relation, it should update when you regenerate the model. You likely just need to regenerate the model after opening it and before you go into the parameters dialog.
As an FYI, with your relation, if your filename is shorter than 7 characters, the regeneration status will always be yellow. We run into the same issue when we start designs and the model names are simple (like bolt.prt). Once we assign "real" names (i.e. our part numbers) to the models, the relations are successful and the status will go green.
Dan N.
Ok, I'll give that a try. Thank you very much.
Try
part_number = extract(rel_model_name(),1,string_length(rel_model_name())-4)
which should always work by subtracting off the last 4 characters (.prt or .asm)