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

Transform world units to drawing units - ProDwgtableColumnSizeGet

LarsZiegler
5-Regular Member

Transform world units to drawing units - ProDwgtableColumnSizeGet

Hello,



I'm reading the size of a table column with ProDwgtableColumnSizeGet().


How can I get or convert the size to drawing units.


I tried it with ProDrawingSheetTrfGet.. and ProPntTrfEval but nothing works...


Some ideas?



Thanks for your help!



Greetings Lars




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

I Lars,

I’ve a similar problem setting the position of a note in a drawing.

I followed these steps:



1) Setting the attach point to ‘translate’

2) find the transformation matrix of the sheet ( from screen a drawing coordinates ) using ProDrawingSheetTrfGet (ProMatrix)

3) calculate the inverse matrix

4) translate the vector from drawing to screen coordinate using ProVectorTrfEval

5) add eventual shift to the new vector



ProVector pos;

ProMatrix matrix, inverse_matrix;



// initialize the position

pos[0]=X;

pos[1]=Y;

pos[2]=0.0;



// get the matrix from screen to drawing coordinates

ProDrawingSheetTrfGet ( drawing, i, wNomeFormato, matrix );



// get inverse matrix ( from drawing to screen coordinates )

ProUtilMatrixInvert( matrix, inverse_matrix );



// drawing to schermo

ProVectorTrfEval ( pos, inverse_matrix, pos );



// add shift

pos[0]+= inverse_matrix [3][0];

pos[1]+= inverse_matrix [3][1];



You can find ProUtilMatrixInvert in <proe_root>\protoolkit\protk_appls\pt_examples\pt_utils\UtilMatrix.c



I hope this help.



Michele Giudici



Descrizione: Logo CDT piccolo

CAD.I.TECH - CAD Integration TECHnology S.r.l

+ via Montevideo 7, 16129 Genova

( 010 362 62 66 - Ê 010 362 62 67
LarsZiegler
5-Regular Member
(To:LarsZiegler)

Hello,


thanks for your answer.


The problem was the number of the column.


In some Toolkit functions the index starts at 1 but in
ProDwgtableColumnSizeGet the index starts at 0!!!


Here my code:


ProPoint3dpt;
ProMatrixMatrix;
intSheet;
ProNameSheetSize;

pt[0] = 0.0;
pt[1] = 0.0;
pt[2] = 0.0;
err = ProDrawingCurrentSheetGet(m_Drw, &Sheet);
err = ProDrawingSheetTrfGet(m_Drw, Sheet, SheetSize, Matrix);

if (m_ATitleCells.size() > 0)
{
err = ProDwgtableColumnSizeGet(&m_ATitleCells[0].Table,
0, m_ATitleCells[0].Column - 1, &pt[0]);
ProVectorTrfEval(pt, Matrix, pt);
OS << L"ColSize (" << m_ATitleCells[0].Column << L"): " << pt[0] << endl;
}


Greetings Lars

Announcements