Skip to main content
13-Aquamarine
September 7, 2022
Question

model_name + "custom text" in a drawing parameter relation

  • September 7, 2022
  • 3 replies
  • 3194 views

is there any way to add custom "text" to end of drawing parameter relation below?

 

we'd like to truncate the "model name last 3 characters" then add text "DOC1"

for our drawing title blocks

 

DOC_NO=extract(rel_model_name(),1,string_length(rel_model_name())-3)"DOC1"

 

thanks

Rich

3 replies

23-Emerald IV
September 7, 2022

Drawing programs have a greatly reduced subset of valid commands.  You should be able to display this on the drawing by using a single cell repeat region as long as you don't actually need a drawing parameter populated with this value.  What version of Creo Parametric are you running?

23-Emerald IV
September 7, 2022

Example with Creo Parametric 8.0

 

TomU_0-1662588835114.png

 

TomU_1-1662588866330.png

 

23-Emerald III
September 7, 2022

You had it close.

DOC_NO=extract(rel_model_name(),1,(string_length(rel_model_name())-3))+'DOC1'

Test the extract portion to be sure it gives you what you want.

 

23-Emerald IV
September 7, 2022

That will work as long as they want to add the relation to the model, but it won't work in a drawing unless it's added to a repeat region.

joe_morton
18-Opal
September 23, 2022

Do you have 1 drawing per model? You might be able to add the relation in the model itself, then reference that parameter in the drawing. This might be a little more flexible to use than dealing with repeat regions.