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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

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

TomasLoun
4-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


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 ACCEPTED SOLUTION

Accepted Solutions

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

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.

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

TomasLoun
4-Participant
(To:GabrielZaha)

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

Top Tags