CAD/CAM discussion forum > CAD Tutorial & Tips > [Tips] Why zcedGetArgs do not work when passing a list?

[Tips] Why zcedGetArgs do not work when passing a list?

    
  Subscribe Topic

Rank: 5Rank: 5

Arphone

posts: 26

Registered: 2012-6-25

Message 1 of 1

 [Tips] Why zcedGetArgs do not work when passing a list?
16-05-2013 05:38 . pm   |   View his/her posts only
When you define a lisp with ZRX and pass a list as argument, sometimes you will find zcedGetArgs don't return a expected resbuf list. This is because when passing a list with 3 numbers as argument, ZWCAD+ will treat it as a RT3DPOINT. Following is a sample to show how to handle this situation:

struct resbuf * rb = NULL;
rb = zcedGetArgs ();
if (!rb || (RT3DPOINT != rb->restype) || rb->rbnext)
{
return RTERROR;
}
double d1 = rb->resval.rpoint[0];
double d2 = rb->resval.rpoint[1];
double d3 = rb->resval.rpoint[2];
See also
X