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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Wrap Text in Tables

DonSenchuk
7-Bedrock

Wrap Text in Tables

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 16

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

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

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


StephenW
23-Emerald II
(To:DonSenchuk)

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]

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

So, the answer to the question I guess is "no".

Typical half-baked PTC solution.

--
--
Doug Schaefer | Experienced Mechanical Design Engineer
LinkedIn

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

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
StephenW
23-Emerald II
(To:DonSenchuk)

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.

egifford
4-Participant
(To:DonSenchuk)

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

Erik,


We're not seeing either problem in our tables (Creo 2.0 M040). A sample is attached.


I experimented with dumb text and parameters and with different text justification. In all cases it seems to work as I would want. And I'm not aware of any configuration options that would affect table margins.

egifford
4-Participant
(To:DonSenchuk)

Mark,


I ended up opening a call with PTC tech support about this. From what we were able to determine, the automatic height adjustmentwithin merged cells will work fine with new tables on new drawings created in Creo 2. However, if it is a Pre-Creo drawing (in our case we're coming from WF4), neither new tables nor tables created from table files originating in WF4 will auto height adjust in merged cells.It also fails to work ina new in Creo 2 drawing when using a table file originating in WF4.PTC hasopened an SPR to investigate this.



Erik

BenLoosli
23-Emerald II
(To:DonSenchuk)

That makes sense since the code change is in the table structure itself. Only new tables created in Creo2 would have the ability to wrap text.

I will not be surprised if R&D comes back with "working as designed".

It will take an enhancement request and an act of a Supreme Being to get the table functionality to update existing tables.


The developers had a choice. They can update the table structure when they find an old one andcontinuewiththat or they can create anothertable structure to use in parallel with the old one(s).

They (presumably) will always have to read in the old structure(s) in order to read/modify old drawings. They will always use the latest table structure to create new tables.


If tables aren't being updated, then two things are possible - either PTC failed to update the tables as they intended to or PTC decided it was OK to make it harder on their customers and save a little development time to make updating the table structure work, and not including a message indicating "Old table not updated - Create new table to use new features."


Since the two outcomes look the same, I'm interested in which turns out to be true.

Exactly what we found. The issue is you have to open up the tables and save them again so they work correctly.
The problem is, before m060, when we would bring up our drawing that had all the tables on it, Creo would crash when you tried to save out a table. That's the problem that was fixed in m060.

Our BOM tables are separate from the drawing template, so we just have to remove and insert again, but then of course you just lost all your filtering, and fixing of the index.

David Haigh
egifford
4-Participant
(To:DonSenchuk)

PTC came just got back to me on this confirming there is a bug. However, there is a workaround. So far it has worked for me.



To correct the issue:



  1. Open the drawing

  2. File > Prepare > Drawing Properties > Detail Options change

  3. Add option as update_drawing and value as 2069392 > Add/Change > Ok

  4. Review> Update sheets > Update tables


Erik

Top Tags