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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Table column width adjustment

Ketan_Lalcheta
19-Tanzanite

Table column width adjustment

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.
5 REPLIES 5

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  |+|

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

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  |+|

Hi,

I resumed work today. Could not check this yet but I verified that ProDtlnoteLineEnvelopeGet is available for Creo 2.0 M090. I will share my test results soon.

Thank you once again for this solution.

Regards

Ketan

Hi,

I am able to do call this API and API results are looks okay. Still I am not getting proper results. Below are steps I have followed:

  • ProDwgtableColumnSizeGet() API gives actual column size in world unit as per API documentation (Which is neither )
  • ProDtlnoteLineEnvelopeGet() API gives required column size in screen coordinates.
  • Issue I am facing is to decide between world unit and screen coordinates.

Again stuck to set column width.

Thanks and Regards

Ketan

Top Tags