Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I want to include the part number within a title block so it displays properly on a detail drawing. I want to use &model_name with .PRT at the end so show the extension or .ASM if it's an assembly. Any ideas. I know I've seen it thru out the years.
Bart Brejcha
We use &type in the formats. This will give you PART, ASSEM, etc, but not prt, asm
So, with this bit of info, a possible solution to the original problem could be to use some relations to define a drawing parameter that is then used in the title block:
(1) Define a drawing parameter, let's call it "partname", with type STRING.
(2) Put in some relations to build the parameter up from the known data:
partname = &model_name IF &type == "PART" partname = partname + ".prt" ENDIF IF &type == "ASSEM" partname = partname + ".asm" ENDIF
(3) In your title block, use &partname rather than &model_name.
Keep in mind I'm just using the information you provided, I am not sure of the spelling of the "official" parameters and their possible settings. There might be additional &type variants I don't know, etc.
Some new repeat region parameters were added to Creo 5 that makes doing this very simple. Follow the same concept that @KenFarley suggested, but place the relations inside a single cell repeat region on the drawing.
Sample files are attached.