- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am new to ARX. I appreciate any help in advance.
My task at hand is to create a command that will take two points, select a few things in the vicinity of line of these two points and process the selected things. To do this, I am doing the following
1. Take two points from the user, which are in WCS.
2. Convert the two points using acedTrans from WCS to DCS
3. Add a small displacement to these points to get corners of the polygon I want to form.
4. Pass these points to acedSSGet.
The acedSSGet returns -5001, which I think is "other error".
What I don't understand is
1. If the points are in DCS, I expect them to be on XY plane (have same Z values). But that is not the case. The points are allover. Not even on XZ or YZ plane. If that's the case, what is the meaning of DCS? What CS the acedSSGet expect?
Code is as follows
--------------------------
ads_point startpt_wcs, endpt_wcs, startpt_dcs, endpt_dcs;
// AT THIS POINT, I ALRADY HAVE STARTPOINT AND ENDPOINT INPUT BY THE USER
CGeomEntities::GetAdsPointFromAcgePoint(StartPoint, startpt_wcs);
CGeomEntities::GetAdsPointFromAcgePoint(EndPoint, endpt_wcs);
// Convert to DCS
resbuf *rb_wcs = acutBuildList(RTSHORT, 0, RTNONE);
resbuf *rb_dcs = acutBuildList(RTSHORT, 2, RTNONE);
if (RTNORM != acedTrans(startpt_wcs, rb_wcs, rb_dcs, 0, startpt_dcs))
return false;
if (RTNORM != acedTrans(endpt_wcs, rb_wcs, rb_dcs, 0, endpt_dcs))
return false;
// Adjust points to form a crossing window
ads_point top_left_dcs, bottom_right_dcs;
double deltaX = dFuzz* 0.7071;
if ( startpt_dcs[X] > endpt_dcs[X])
deltaX *= -1;
double deltaY = dFuzz* 0.7071;
if ( startpt_dcs[Y] > endpt_dcs[Y] )
deltaY *= -1;
top_left_dcs[X] = startpt_dcs[X] - deltaX;
top_left_dcs[Y] = startpt_dcs[Y] + deltaY;
top_left_dcs[Z] = startpt_dcs[Z];
bottom_right_dcs[X] = endpt_dcs[X] + deltaX;
bottom_right_dcs[Y] = endpt_dcs[Y] - deltaY;
bottom_right_dcs[Z] = endpt_dcs[Z];
// Use crossing window for selection
int ret = acedSSGet( _T("C"), top_left_dcs, bottom_right_dcs, NULL, crossingcheckpipes);
// AT THIS POINT RET = -5001?? WHY? WHAT AM I MISSING?
acutRelRb(rb_dcs);
acutRelRb(rb_wcs);
if (ret != RTNORM)
return false;
return true;Thanks in advance,
K
Solved! Go to Solution.