static AcDbFullSubentPath oldPath;
static AcDbObjectId oldId;
//-----------------------------------------------------------------------------
Acad::ErrorStatus CIPMReactor::monitorInputPoint (
bool &appendToTooltipStr,
ACHAR *&additionalTooltipString,
AcGiViewportDraw *drawContext,
AcApDocument *document,
bool pointComputed,
int history,
const AcGePoint3d &lastPoint,
const AcGePoint3d &rawPoint,
const AcGePoint3d &grippedPoint,
const AcGePoint3d &cartesianSnappedPoint,
const AcGePoint3d &osnappedPoint,
AcDb::OsnapMask osnapMask,
const AcArray<AcDbCustomOsnapMode *> &customOsnapModes,
AcDb::OsnapMask osnapOverrides,
const AcArray<AcDbCustomOsnapMode *> &customOsnapOverrides,
const AcArray<AcDbObjectId> &apertureEntities,
const AcArray<AcDbObjectIdArray, AcArrayObjectCopyReallocator<AcDbObjectIdArray> > &nestedApertureEntities,
const AcArray<Adesk::GsMarker> &gsSelectionMark,
const AcArray<AcDbObjectId> &keyPointEntities,
const AcArray<AcDbObjectIdArray, AcArrayObjectCopyReallocator<AcDbObjectIdArray> > &nestedKeyPointEntities,
const AcArray<Adesk::GsMarker> &keyPointGsSelectionMark,
const AcArray<AcGeCurve3d *> &alignmentPaths,
const AcGePoint3d &computedPoint,
const ACHAR *tooltipString
) {
appendToTooltipStr =false ;
__int64 gsmarker = -1;
ads_name ename;
struct resbuf *rbChain;
ads_point selPt;
ads_matrix mx;
selPt[X] = rawPoint.x;
selPt[Y] = rawPoint.y;
selPt[Z] = rawPoint.z;
// Select a single object. If it's a block reference or a sub-entity
// within a block reference, rbChain will not be null.
unsigned int uTransSpaceFlag = 1;
// set uTransSpaceFlag to 0, if the current layout is in model space
struct resbuf rb;
acedGetVar(_T("CVPORT"), &rb);
if (rb.resval.rint != 1)
uTransSpaceFlag = 0; // Model space
// now do the entity select
int stat = acedNEntSelPEx(_T("\nPick entity : "), ename,
selPt, 1, mx, &rbChain, uTransSpaceFlag, &gsmarker);
// if everything worked ok
AcDbEntityPointer oldEnt(oldId,AcDb::kForRead);
if(oldEnt.openStatus()==Acad::eOk)
oldEnt->unhighlight(oldPath);
if (RTNORM == stat && rbChain!=NULL)
{
AcDbFullSubentPath subentIds;
int numInserts = 0;
for (resbuf* currentInsert = rbChain; currentInsert != NULL;
currentInsert = currentInsert->rbnext)
numInserts++;
Acad::ErrorStatus err;
// it is inside a block
if (numInserts > 1)
{
// create an array
AcDbObjectId* Inserts = new AcDbObjectId[numInserts];
int currNumber = 0;
for (resbuf* current = rbChain;
current != NULL;
current = current->rbnext, currNumber++)
acdbGetObjectId(Inserts[currNumber],
current->resval.rlname);;
AcDbEntityPointer pEntHighlight(Inserts[numInserts-2],AcDb::kForRead);
//numInserts-2 -- потому что при выполнение из Layout, верхний элемент это AcDbViewport
for (int i = numInserts-2; i>=0;i--)
{
//check how deep to dig
//resbuf * rb = NULL;
//getXdata(Inserts[i],PZ_NOM,rb);
//if(rb!=NULL) { acutRelRb(rb); break; }
subentIds.objectIds().append(Inserts[i]);
}
pEntHighlight->highlight(subentIds);
oldId = Inserts[numInserts-2];
oldPath = subentIds;
}
acutRelRb(rbChain);
}
return (Acad::eOk) ;
}