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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Extracting data from drawing name in forms

ptc-2601364
1-Newbie

Extracting data from drawing name in forms

Hello, I am creating a drawing form for a company. The drawing name, file name, has the syntax RT345891. I want to rewrite this in the drawing to 4-345.891. In the form I have the parameter &dwg_name which writes the file name RT345891 in the drawing. My idea was to use the function: partofmydrawingnumber = extract(&dwg_name,3,3) to create the new string in a repeat region as a relation. But the parameter &dwg_name is not recognised in the relation as an parameter, it creates an error message. Do anyone know how I can use the &dwg_name, another name for the file name parameter or any other get around? What is the syntax to create these parameters in the form but have them echoed in the drawing?
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
5 REPLIES 5

I think you need to get the "&" out of your extract function; the & is a special character for printing a value in tables and notes, but the parameter name itself is just dwg_name.

I did not succeed. I cannot find a parameter with the models name, file name, thet can be used in a relation in the form. I believe this is because the form cannot see any model. So I created a parameter and a relation in the part instead. Something I did not want to do, as I do not want relations in the start part...

I'm not sure exactly what you are trying to do, but you can write a relation in the drawing to extract the model name as a starting point. Try "NAME=rel_model_name()". "[/b]&NAME "in the drawing will now show the source model name.

Then, of course, you can operate on your new parameter "NAME". Assuming from your example that you just arbitrarily add the "4-" at the beginning of the new parameter you are trying to create (I don't know where that comes from), you would then create another parameter something like this: X=extract(NAME,3,3) Y=extract(NAME,6,3) NEW_DWG_NAME="4-"+X+"."+Y

Ignore that stray "[b]" in the post before last.
Top Tags