home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
may94cad.zip
/
POLYPT2.C
< prev
next >
Wrap
Text File
|
1994-04-25
|
1KB
|
41 lines
/* POYLPT2.C (c)1994, Anthony Hotchkiss */
int polypt2 (void)
{
struct resbuf *elist, *item, *cblks, from, to;
ads_matrix xmat;
ads_name ename;
ads_point pt, pnew, pnew2;
int x;
x = ads_nentselp(NULL,ename,pt,0,xmat,&cblks);
if (x != RTNORM)
return RTERROR;
ads_redraw(ename, 3);
ads_getpoint(NULL,"\nEnter a new point: ",pnew);
from.restype = RTSHORT; /* Note that a coordinate */
to.restype = RTSHORT; /* transformation is made */
from.resval.rint = 1; /* on the selected new position */
to.resval.rint = 0; /* of the vertex to be moved. */
x = ads_trans(pnew,&from,&to,0,pnew2);
/* The ads_trans function is used to transform the user
supplied new point from its current UCS to the world
coordinate system before the ads_entmod change is made */
if (x != RTNORM)
return RTERROR;
elist = ads_entget(ename);
for (item=elist; item; item = item->rbnext)
if (item->restype == 10)
{
item->resval.rpoint[X] = pnew2[X]; /* replace X */
item->resval.rpoint[Y] = pnew2[Y]; /* replace Y */
item->resval.rpoint[Z] = pnew2[Z]; /* replace Z */
ads_entmod(elist); /* modify the sub entity */
}
ads_entupd(ename); /* modify the entire entity */
if (elist != NULL)
ads_relrb(elist);
if (cblks != NULL)
ads_relrb(cblks);
ads_retvoid();
} /* polypt2 */