Skip to main content
12-Amethyst
January 6, 2014
Question

Wrap Text in Tables

  • January 6, 2014
  • 16 replies
  • 7568 views

Whenever a user creates a new drawing, our formats are set up to use parameters from the model (of course).


Despite the addition of a Wrap Text option since WF5.0, it appears there is no way to get a table cell that contain a parameter to wrap text properly. Three software releases later.


When I asked about it, PTC, in their infinite wisdom, directed me to CS28238 which provides a solution of splitting the one parameter up into several different parameters and adding them all to the table cell, thereby allowing a portion of the parameter's contents to be displayed in each line. This, of course, is just a long way of saying, "Wrap text doesn't work at all in these cases." In short, they gave us a pseudo improvement.


In the meantime, the only solution I could come up with is to add a dummy column at the left and right ends of any table cell that will contain wrapped text (mostly just the Description cell in the title block). I can then put the parameter into the middle cell, hide the line between the cells and fake it.


Anyone else have a solution or thoughts on how best to handle this?


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.

16 replies

13-Aquamarine
January 6, 2014
Line wrap works in Creo 2.0-m060 and later.

There is a poor man's method to do this. We used repeat region relations in wf4 and before. However we have converted to the new functionality as of m060.

Essentially you count the number of characters in the line and look for an empty space where you can wrap the line. I showed this monstrosity to PTC quite some time ago and told them they needed to come up with a better way. It finally happened.

/*BOM_DESCRIPTION_ASM WORD WRAP @ 32 CHARACTERS
des_line1="
des_line2="

if exists("asm_mbr_bom_description_asm")

des_len = string_length(asm_mbr_bom_description_asm)
des_line1 = asm_mbr_bom_description_asm
des_line2 = "

if des_len > 29
des_c29 = extract(asm_mbr_bom_description_asm,29,1)
if des_c29 == " "
endlen = des_len-29
des_line1 = extract(asm_mbr_bom_description_asm,1,29)
des_line2 = extract(asm_mbr_bom_description_asm,30,endlen)
else
des_c28 = extract(asm_mbr_bom_description_asm,28,1)
if des_c28 == " "
endlen = des_len-28
des_line1 = extract(asm_mbr_bom_description_asm,1,28)
des_line2 = extract(asm_mbr_bom_description_asm,29,endlen)
else
des_c27 = extract(asm_mbr_bom_description_asm,27,1)
if des_c27 == " "
endlen = des_len-27
des_line1 = extract(asm_mbr_bom_description_asm,1,27)
des_line2 = extract(asm_mbr_bom_description_asm,28,endlen)
else
des_c26 = extract(asm_mbr_bom_description_asm,26,1)
if des_c26 == " "
endlen = des_len-26
des_line1 = extract(asm_mbr_bom_description_asm,1,26)
des_line2 = extract(asm_mbr_bom_description_asm,27,endlen)
else
des_c25 = extract(asm_mbr_bom_description_asm,25,1)
if des_c25 == " "
endlen = des_len-25
des_line1 = extract(asm_mbr_bom_description_asm,1,25)
des_line2 = extract(asm_mbr_bom_description_asm,26,endlen)
else
des_c24 = extract(asm_mbr_bom_description_asm,24,1)
if des_c24 == " "
endlen = des_len-24
des_line1 = extract(asm_mbr_bom_description_asm,1,24)
des_line2 = extract(asm_mbr_bom_description_asm,25,endlen)
else
des_c23 = extract(asm_mbr_bom_description_asm,23,1)
if des_c23 == " "
endlen = des_len-23
des_line1 = extract(asm_mbr_bom_description_asm,1,23)
des_line2 = extract(asm_mbr_bom_description_asm,24,endlen)
else
des_c22 = extract(asm_mbr_bom_description_asm,22,1)
if des_c22 == " "
endlen = des_len-22
des_line1 = extract(asm_mbr_bom_description_asm,1,22)
des_line2 = extract(asm_mbr_bom_description_asm,23,endlen)
else
des_c21 = extract(asm_mbr_bom_description_asm,21,1)
if des_c21 == " "
endlen = des_len-21
des_line1 = extract(asm_mbr_bom_description_asm,1,21)
des_line2 = extract(asm_mbr_bom_description_asm,22,endlen)
else
des_c20 = extract(asm_mbr_bom_description_asm,20,1)
if des_c20 == " "
endlen = des_len-20
des_line1 = extract(asm_mbr_bom_description_asm,1,20)
des_line2 = extract(asm_mbr_bom_description_asm,21,endlen)
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif

David Haigh
13-Aquamarine
January 6, 2014
So I just read CS28238.
That's ridiculous, although the relation we used to use was a monstrosity, it's far better than the solution PTC suggested.

David Haigh
12-Amethyst
January 6, 2014
M060 or newer? Outstanding. Thanks for the update.

Also, great googly mooglies man! For the longest time I thought this old one was crazy. (The user manipulates NB_1 & NB_2 as number of characters before line breaks 1 and 2 respectively.)

/*  RELATION TO CUT NOMENCLATURE INTO 3 PARTS TO FIT IN DRAWING BLOCK
/*
/* NB_1 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT FIRST POINT
/* NB_2 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT SECOND POINT
NB_1=6
NB_2=40
/*
/*
NOMENCLATURE_1=NOMENCLATURE
NOMENCLATURE_2="
NOMENCLATURE_3="
NOMENCLATURE_LENGTH=STRING_LENGTH(NOMENCLATURE)
IF NOMENCLATURE_LENGTH > NB_1 & NOMENCLATURE_LENGTH <= NB_2
   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)
   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NOMENCLATURE_LENGTH-NB_1)
ENDIF
IF NOMENCLATURE_LENGTH > NB_2
   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)
   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NB_2-NB_1)
   NOMENCLATURE_3 = EXTRACT(NOMENCLATURE,NB_2,(NOMENCLATURE_LENGTH-NB_2))
ENDIF


23-Emerald III
January 6, 2014
So after how many years (I know we asked PTC about it in 1996). Wow, they listened, I'm impressed. I had to test it because I didn't believe it. Not that I didn't believe David, I just didn't believe it.

[cid:image001.png@01CF0AE1.BD1A71E0]

13-Aquamarine
January 6, 2014
So the advantage to the huge relation we used to use is it only wraps on a space. The example you show below wraps right in the middle of the word "does".

David Haigh
21-Topaz II
January 6, 2014
So, the answer to the question I guess is "no".

Typical half-baked PTC solution.

--
13-Aquamarine
January 6, 2014
By the way, the issue that was fixed in m060 was the inability to save the tables after modifying them to the new line wrap functionality.

We insert our BOM tables after the fact, since we have a number of different ones. Some showing weight and density for each item some not.

Issue Information
Short Description

Creo Crashes when trying to save tables with repeat regions to file (Save as Table).

Symptoms

Steps to Reproduce

Attaching drawing files with a number of tables outside the format on the right. Scroll over to see them. Select a table and save. My system was able to save about 5 tables before it Creo crashed. Starting Creo again and trying to save another resulted in immediate unresponsiveness. Memory usage spiked to 6.85gb. Only have 8gb on the system. Was unable to get an accurate memory usage for Xtop from perfmon because as it started to show the spike it became unresponsive also. Attaching a zip file for the drawing and required file and a traceback log.

Error Messages / Warnings

Reason for Closure

Solution Delivered

Closure Details

Informed the customer that SPR 2177074 has been resolved in Creo Parametric 2.0 M060.


SPR

2177074

Status

Closed

Severity

High

Created Date

23-Apr-2013

Description

Creo Crashes when trying to save tables with repeat regions to file (Save as Table).


David Haigh
13-Aquamarine
January 6, 2014
In my experience, I can force it to wrap where I want by adding spaces, but that's kind of messed up also.

David Haigh
23-Emerald III
January 6, 2014
I agree that my accidental example is a little excessive from the standpoint of not having a space. An SPR might come in handy since we occasion use an oddly long hyphenated words that would have this same problem. So after I check that scenario, I will call it in and ask for the "breaks" to be done at spaces and punctuation.

12-Amethyst
January 7, 2014

I was just testing this functionality as we prepare to move from Wildfire 4 to Creo 2 M090. It works pretty well (finally). But it looks like it leaves a margin to the right of several characters. Does anyone know of a setting for this?


The other add to tables with this transition was auto height adjustment, but I'm finding it does not work if the table cell you're working with is actually several merged cells. Can anyone else confirm this? I was hoping the auto-height would be a nice setting for our revision table.


see attached picture