Skip to main content
1-Visitor
November 18, 2015
Question

Table column width adjustment

  • November 18, 2015
  • 1 reply
  • 4222 views

Hello,

I would like to increase or decrease the width of table column based on content into it. My table is repeat region table having BOM details.

Could anyone please help me to know how to achieve the same through toolkit?

I am able to get column width using ProDwgtableColumnSizeGet. I am confused what to do for knowing whether content is fit inside this width or not.

Regards

Ketan


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.

1 reply

1-Visitor
November 18, 2015

Hi Ketan -

I haven't done this myself, so I can only offer suggestions. If your table contains only ProDtlnote entities, you could try the following for each ProDtlnote in the column:

  1. Get the note's line count
  2. Execute ProDtlnoteLineEnvelopeGet on each line number.
  3. For each line envelope:
    1. Get the minimum and maximum X values
    2. Compare this line's minimum/maximum values to those of previous lines.
    3. Save least minimum and greatest maximum X in the column
  4. Compute the minimum column width as the difference of the maximum and minimum X values
  5. Add some padding to the width before resizing the column.

The release notes for Creo Parametric Toolkit 3.0  state that the accuracy of ProDtlnoteLineEnvelopeGet and its related functions now "provide more accurate results":

The following PTC Creo Parametric TOOLKIT functions provide more accurate results:

    •      ProDwgtableRowSizeGet()

    •      ProDrawingTablesUpdate()

    •      ProDtlnoteLineEnvelopeGet()

    •      ProNoteLineEnvelopeGet()

Previously, these functions returned results based on inappropriate character size and these results were inconsistent under different conditions.

This may imply that they don't work very well on Creo 2.0 and earlier.

|+|  M a r k  |+|

1-Visitor
November 19, 2015

Thank you Mark. Unfortunately, I am having Creo 2.0 M090.I would still try this and share results with you.

Thanks and Regards

Ketan

1-Visitor
November 19, 2015

Ketan -

Please do give this a try and report your results here. In the meantime, we might hear from someone else who has already worked on this problem.

Unfortunately, I am having Creo 2.0 M090.

The section I quoted from the Creo 3.0 Parametric Toolkit Release Notes did not specify when ProDtlnoteLineEnvelopeGet was updated, so it's worth trying on Creo 2.0 M090.

Good luck -

|+|  M a r k  |+|