Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatinating text parameters

  • Thread starter Thread starter Tunalover
  • Start date Start date
Status
Not open for further replies.
T

Tunalover

Guest
Dear Colleagues-
Where I work we use a base number, say 349854, for our drawings but none of our drawings or models currently have a drawing number text parameter. We'd like to extract the drawing number from the model name text parameter which includes a hyphen and a four-digit dash number e.g. 349854-0019.

For the model name of the generic instance we use a zero dash number e.g. 349854-0000. For family table instances we use non-zero dash numbers e.g. 349854-0905. Using relations, is it possible to take a model name and strip the hyphen and dash number to come up with the basic drawing number '349854'? In other words, is it possible to concatinate a text parameter in a relation? Here's what I'd like to do (please excuse the syntax):

If modelno were, say, 349854-0000 or, say, 349854-0114, it would be nice to do:
dwgno = modelno - '-****'
ending up with
dwgno=349854

Thanks for your help! I'm new to Pro/Program and parameters and this is something we need to do badly.
smiley5.gif
 
We use similar procedure with our models. By extracting characters from model name (file name) we get parameters, which we then concatenate into one string. This string has to be text string and by extracting characters from model name you alse get text parameters.


E.g.:


modelno=extract(rel_model_name,19,3)
dwgno=modelno+"-"+"-****"


To explain extract function in Pro/E: rel_model_name extracts characters from the model name, first number (e.g. 19) is the beginning position of the character in the model name and the second number (e.g. 3) is the number of the characters to extract beginning from the position of the first character. Complicated? Not really. In you case, where you want to extract text from model name, there are 6 characters, and the parameter should start from the first character, so the relation would be:


dwgno=extract(rel_model_name,1,6)


Then in relations, you can concatenate parameters with "+" sign. But remember, all parameters must be the same type (number, string, ...). To convert from number to string you can use the ITOS function.


But as I see you really don't have to concatenate/subtract text from the parameter,you just extract it from the model name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top