Code Red > ARX Programming
Draw a simple line...
LE:
Here is a function to draw a simple LINE on model or paper space.
The code does not have any descriptions or comments.
--- Code: --- static int ads_myline(void)
{
struct resbuf *pArgs =acedGetArgs () ;
if( !pArgs ||
pArgs->restype != RTPOINT ||
!pArgs->rbnext ||
pArgs->rbnext->restype != RTPOINT ||
pArgs->rbnext->rbnext )
{
ads_point& pnt1 = pArgs->resval.rpoint;
AcGePoint3d pntStart( pnt1[X], pnt1[Y], pnt1[Z] );
ads_point& pnt2 = pArgs->rbnext->resval.rpoint;
AcGePoint3d pntEnd( pnt2[X], pnt2[Y], pnt2[Z] );
}
--- End code ---
Usage: (myline (getpoint "\nFrom: ") (getpoint "\nTo: "))
LE:
I posted myline function because all the functions or samples on how to draw a line with objectARX on books or in the net [at least by my research], are not complete and do not have the ability to pick the points or to draw the line on paper or model space....
MickD:
So, do you use this in a lisp routine calling 'myline' with some user input from lisp which calls ads_myline passing in the arg's?
I've never looked at ads or linking with lisp. You would still need your entry point etc yes?
LE:
--- Quote from: MickD on November 16, 2005, 12:18:45 am ---So, do you use this in a lisp routine calling 'myline' with some user input from lisp which calls ads_myline passing in the arg's?
I've never looked at ads or linking with lisp. You would still need your entry point etc yes?
--- End quote ---
I am creating my solution using the ARXwizard, by default if you make a function it will place an ads_yourFunctionNameGoesHere.
With the ARXwizard, the code basic or skeleton are generated.... is kind of different as the normal entry point.
Kerry:
Hi Luis
Just an academic question ..
I've noticed you prefix a lot of your functions with ads_
Is there any special reason you use this prefix ... I usually associate it with Acad prefix for translations of the original Lisp routines into C.
Navigation
[0] Message Index
[#] Next page
Go to full version