Create a Simple Draft sketch line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Create a Simple Draft sketch line
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.
- Labels:
-
ProToolkit
-
Toolkit
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
\*====================================================================*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry, misinterpreted the question. This is about Toolkit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My bad. Yes I am trying create the line in ProToolkit, with no user input. Want the line to appear automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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 as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mark you are using a wrong API, what you need is ProDtlentityCreate(...). There is protk example file TestDtlentity.c with working code.
HIH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks I will take a look at that!.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
\*====================================================================*/
