void
cmdAXY()
{
ads_name ss;
TCHAR Kw[10];
int rc;
rc = acedSSGet(NULL, NULL, NULL, NULL, ss);
if (rc != RTNORM) return;
acedInitGet(1, _T("X Y"));
acedGetKword(_T("\nAlign Direction:<X/Y>"), Kw);
//Khai báo, định nghĩa gốc 0 UCS
ads_point pt0,pt1,pt2,pt1T;
pt0[0] = 0;
pt0[1] = 0;
pt0[2] = 0;
//Định nghĩa pt1
acedInitGet(1,NULL);
rc = acedGetPoint(pt0, _T("\n Select the first point:"), pt1);
if (rc != RTNORM) return;
//Định nghĩa pt2:
acedInitGet(1, NULL);
rc = acedGetPoint(pt1, _T("\n Select the second point:"), pt2);
if (rc != RTNORM) return;
struct resbuf* cmdlist;
if (_tcscmp(Kw, _T("X")) == 0)
{
pt1T[0] = pt1[0];
pt1T[1] = pt2[1];
pt1T[2] = pt1[2];
}
else
{
pt1T[0] = pt2[0];
pt1T[1] = pt1[1];
pt1T[2] = pt1[2];
}
cmdlist = acutBuildList(RTSTR, _T(".move"), RTSTR, _T("P"),RTSTR,_T(""),RTPOINT
, pt1, RTPOINT, pt1T, 0);
acedCmdS(cmdlist);
acutRelRb(cmdlist);
acedSSFree(ss);
}