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

How to insert table to the right upper corner of the drawing

SOLVED
Participant

How to insert table to the right upper corner of the drawing

Hi,

when I am creating new table or inserting it by ProDrawingTableCreate or ProDwgtableRetrieve I have to specify the origin - the point where the table is inserted.

This point is in screen coordinates, but I need to place the table to concrete position (for example right upper corner) on the drawing, not on screen. How to recalculate the drawing position to the screen coordinates?

Tom

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to insert table to the right upper corner of the drawing

You need the transformation matrix from drawing coordinates to screen coordinates.

What I found that work best for me is to get the transformation from screen to drawing coordinates first using ProDrawingSheetTrfGet function

Then I calculate the inverse matrix. Use the inverse matrix in ProPntTrfEval function to get the screen coordinates.

Here is a sample code:

status = ProDrawingSheetTrfGet(drawing,1,drw_size,matrix1);

ProUtilMatrixInvert(matrix1,matrix2);

ProPntTrfEval(drw_point,matrix2,scr_point);

status = ProDwgtableRetrieve(drawing, tableName, table_path, 0, scr_point, NULL, NULL, &table);

status = ProDwgtableDisplay(&table);

You can find the ProUtilMatrixInvert function in <Creo load point>\protoolkit\protk_appls\pt_examples\pt_utils\UtilMatrix.c

View solution in original post

3 REPLIES 3
Highlighted

Re: How to insert table to the right upper corner of the drawing

Hi,

When placing the table, right after selecting the table file a little window pops up that allows to switch to placement based on absolute coords of the drawing.

If you got the table origin at the correct corner of the table you could just specify absolute drawing coords of the corner of your drawing to place it there.

It's just too bad i can't post a picture of the window cause i have no available Creo licence at the moment.

Highlighted

Re: How to insert table to the right upper corner of the drawing

You need the transformation matrix from drawing coordinates to screen coordinates.

What I found that work best for me is to get the transformation from screen to drawing coordinates first using ProDrawingSheetTrfGet function

Then I calculate the inverse matrix. Use the inverse matrix in ProPntTrfEval function to get the screen coordinates.

Here is a sample code:

status = ProDrawingSheetTrfGet(drawing,1,drw_size,matrix1);

ProUtilMatrixInvert(matrix1,matrix2);

ProPntTrfEval(drw_point,matrix2,scr_point);

status = ProDwgtableRetrieve(drawing, tableName, table_path, 0, scr_point, NULL, NULL, &table);

status = ProDwgtableDisplay(&table);

You can find the ProUtilMatrixInvert function in <Creo load point>\protoolkit\protk_appls\pt_examples\pt_utils\UtilMatrix.c

View solution in original post

Highlighted

Re: How to insert table to the right upper corner of the drawing

Thank you Gabriel, this is what I was looking for.

Announcements
Business Continuity with Creo: Learn more about it here.