I thought this could be done at one time:
I want to force a carriage return in a note text.
This note is in relations and it fills in the format table. Therefore I need 1 text string to "wrap" in the table cell.
Somehow I thought a double slash did this "//" but that must have been another program.
Can this be done in Creo?
Example: &title = "THIS IS LINE 1//THIS IS LINE 2"
THIS IS LINE 1
THIS IS LINE 2
In your format .frm file , create a table where you want a note and in the table properties choose wrap text. If is just a note and you don't want that table to show up just erase the table lines or make them invisible. Then if your parameter is bigger then table limits, text will wrap as you want.
Hello Antonius, Hello Hugo!
You can wrap the table with more as one words, but
You don't wrap 1 word as "&title" (Pro/E - Creo programmer can think about).
You can try with two parameters "&title1" and "&title2" in one line.
"&title2" may be empty (with space bar") and wrap the table if You have both
I thought once upon a time we could do this. But then again, maybe I'm hallucinating (again). If it existed, it was back in the days of "Edit Text Line" (which was nice) but we're talking Pro/ENGINEER 2000i or so. I tried a few things that I thought might work. For example, I tried the ASCII code for carriage return (13). You can add certain ASCII symbols by holding Ctrl-A + ASCII Code + Ctrl-B but this just produced junk. I tried all manner of UNICODE characters, escape codes, and other things but couldn't get it to work.
Dimitri is just suggesting using two (or more) different parameters. This is the way we do it at my job.
Hugo is suggesting just to turn on word wrap and let the text naturally wrap within your format table.
These are both good suggestions... but there is one more way. You can take the full string in &title and use a relation to split it and assign it to separate parameters automatically. Let's say you want the string contents of the parameter &title to fill in your title block but if &title has more than 25 characters, it exceeds the boundary of it's table cell. Instead of putting &title in your title block, make a 4-line note that reads:
All 4 parameters will start out blank. You can then use a relation to automatically split &title and populate the 4 new parameters for you. Using a combination of the relation operators string_length(), search(), and extract() you can look for spaces or commas in the original &title string and split at those points.
For example, if:
&title = "THIS IS A VERY LONG STRING THAT PROBABLY NEEDS TO BE SPLIT"
Then, the relation could split this into:
&title_line1 = "THIS IS A VERY LONG"
&title_line2 = "STRING THAT PROBABLY"
&title_line3 = "NEEDS TO BE SPLIT"
&title_line4 = "" (left blank)
The only problem with this technique is that the original &title string is limited to 80 characters. If this is sufficient, then the relations above can be written and you can automate the process. If you need a parameter longer than 80 characters total, you're going to have to take Dimitri's suggestion and use separate parameters filled in manually
If you'd like to try the relations method, let me know and I'll develop the relations you'd need to do the job. It will take a bit of fiddling but I'm confident it can be done.
I do use the relations now and have &material and &finish set up for two separate lines (&finish1 and &finish2)
Of course, the problem is that with 2 lines formatted in the title block, you also have the problem of a single line title looking off-center crowding the top of the block all by itself.
I don't know if a format table cell will wrap if the actual string exceeds the 1st line. Somehow I thought it would ignore wrapping if the relation variable name fit within 1 line. I will have to test that again. I can be bribed into using spaces to force the line-feed at the appropriate location.
Oh, and I tried superscript and subscript too. No joy!
EDIT: okay, word wrap works but it is still a manual process. Not robust if you have a habit of updating formats often. In the drawing, you have to select the table cell and right click and select Wrap Text (or check the box in height and width dialog). If you check the Wrap Text in the cell when creating the table in the format file, it doesn't seem to remember the wrap state when you install the format in a drawing (lame!).
Relation strings needs to recognize a line feed character so one can use a single relation in format tables requiring single line entry or multiple lines entries in title blocks.
In the same vane, tables in format files should remember the Wrap Text state when the format is inserted in the drawing. It is odd that this doesn't behave this way already.
Often, fields such as material, finish and even the title often use only one line of text and on some occasions require a second. In order to keep a tidy drawing format, a one-line text be centered in the cell. When 2 lines are required, again the nomenclature should remain centered.
Is it a bug that the Wrap Text option is not maintained with the table in Creo 2.0?
The work around is to change the cell state in the drawing. However, this can easily be overlooked if someone updates the format and doesn't know about resetting the Wrap Text of the cell.
Ultimately and obviously, the line feed option is the better option although both should be updated. With a line feed code, the user can decide exactly where the wrap should occur.
I'm not the only one who thinks this was once available. Can I get some clarification on this?