• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

request for help for syntax parameters

  • Thread starter Thread starter Lawrence
  • Start date Start date

Lawrence

Guest
Good morning, everyone.
on crèo paramentric 4.0 I need to change the code that appears on the table, going to read the file name, but deleting a part within the text.

example:
filename ------> pippo_topolino_001.prt
separate code --> pippo_001

in the past, who set me the software set me the start part so as to remove the last part of the text (from pippo_topolino_001.prt to pip), using the following strings in the relationships

code = rel_model_name

if search(rel_model_name, "_")!= 0

code=extract(rel_model_name,1,(search(rel_model_name,"_"))-1)


Does anyone know how to change that string to only delete the middle part of the file name?

thanks in advance
 
if the numbers at the end are always three:

code = rel_model_name
nr=string_length(rel_model_name)
if search(rel_model_name, "_")!= 0
code=extract(rel_model_name,1,(search(rel_model_name,"_"))-1+"_"+(extract(rel_model_name,(nr-2),3))
endif

Hi.
hinges
 
if the numbers at the end are always three:

code = rel_model_name
nr=string_length(rel_model_name)
if search(rel_model_name, "_")!= 0
code=extract(rel_model_name,1,(search(rel_model_name,"_"))-1+"_"+(extract(rel_model_name,(nr-2),3))
endif

Hi.
hinges
Bye!
Yes, the numbers are always 3 at the end.
I did a test and it works perfectly! Thank you so much!

To understand how you came to this, however, I would like to understand the syntax of the equation.

rel_model_name --> i guess you indicate the file name (***.prt or [***.asm]
nr --> digit defined by the number of characters within the file name (also counts the file extension? )

Therefore with the "extract" function what is defined?

thanks for the attention and patience: I'm approaching a lot of self-taught crèo.
 
nr --> digit defined by the number of characters of the file name without extension
extract(rel_model_name,2,3) --> result ipp
pipp_

Hi.
hinges
 
nr --> digit defined by the number of characters of the file name without extension
extract(rel_model_name,2,3) --> result ipp
pipp_

Hi.
hinges
Um, okay... I'll do some evidence to get in the speech better!
Thank you for your help and support!
 
if the subject is the same write as well, otherwise open a post with the subject of the request in question.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top