Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I m struggling to find a way to create a single draft entity line on a drawing sheet. Looking to create a line at 0,0 and go to 1,0 (x direction) or from 0,0 to 0,1 (y direction). Can someone point me in the right direction?
Solved! Go to Solution.
Yes, that is wrong, thus will only create temporary lines, or items.
One example as well in UgDtlentityExamples.c
/*====================================================================*\
FUNCTION : UsrLineentityCreate()
PURPOSE : Utility to create a line entity between specified points
\*====================================================================*/
Sorry, misinterpreted the question. This is about Toolkit.
My bad. Yes I am trying create the line in ProToolkit, with no user input. Want the line to appear automatically.
You need the Matrix of ProDrawingBackgroundViewGet()
The window matrix is required as well, because as far I remember x,y,z are screen coordinates.
Multiply the line coords by using the inverse (?) with the Window Matrix, something like this, beside of creating the line.😉
There should be an example in the folder tree.
Thanks 17-peridot, Is the function to create the line ProGraphicsLineDraw ? The line i am creating represents the grain direction on a stainless steel sheetmetal flat. If I have the line on a special layer it can let our CNC nesting software know the direction of grain constraint. The line is to be on a drawing with a view of the flat.
/* Transform points by matrix */ ProUtilPointTrans( trf_matrix, point1, point1 ); ProUtilPointTrans( trf_matrix, point2, point2 ); /* Draw the line */ ProGraphicsPenPosition( point1 ); TEST_CALL_REPORT( "ProGraphicsPenPosition()", "ProTestGraphicsLineDraw()", (ProError)0, 0 ); ProGraphicsLineDraw( point2 ); TEST_CALL_REPORT( "ProGraphicsLineDraw()", "ProTestGraphicsLineDraw()", (ProError)0, 0 );
Mark you are using a wrong API, what you need is ProDtlentityCreate(...). There is protk example file TestDtlentity.c with working code.
HIH
Thanks I will take a look at that!.
Yes, that is wrong, thus will only create temporary lines, or items.
One example as well in UgDtlentityExamples.c
/*====================================================================*\
FUNCTION : UsrLineentityCreate()
PURPOSE : Utility to create a line entity between specified points
\*====================================================================*/