ObjectARX, AutoCAD. Среда программирования библиотеки C++




Высвечивание Вложенных Блочных Ссылок - часть 4


struct resbuf *rbIter = insStack;

AcDbObjectId objId;

acdbGetObjectId(objId, ename);

idArray[count++] = objId;

while (rbIter != NULL) {

ename[0] = rbIter->resval.rlname[0];

ename[1] = rbIter->resval.rlname[1];

acdbGetObjectId(objId, ename);

idArray[count++] = objId;

rbIter = rbIter->rbnext;

}

count--;

acutRelRb(insStack);

// First, we’ll highlight an edge.

//

int numPaths;

AcDbFullSubentPath *subentPaths;

AcGeMatrix3d xform;

es = blRef->getSubentPathsAtGsMarker(

AcDb::kEdgeSubentType,

marker,

pickpnt,

xform,

numPaths,

subentPaths,

count,

idArray);

assert(numPaths == 1);

// Highlight and unhighlight the selected edge.

//

acutPrintf("\nHighlighting the first edge.");

es = blRef->highlight(subentPaths[0]);

pressEnterToContinue();

es = blRef->unhighlight(subentPaths[0]);

// If this is a solid, it will have faces.

// In this case, let’s highlight them.

//

if(ent2->isKindOf(AcDb3dSolid::desc())) {

es = blRef->getSubentPathsAtGsMarker(

AcDb::kFaceSubentType,

marker,

pickpnt,

xform,

numPaths,

subentPaths,

count,

idArray);

assert(numPaths == 2);

// Highlight and unhighlight the selected

// faces.

//

acutPrintf("\nHighlighting the first"

" face.");

es = blRef->highlight(subentPaths[0]);

pressEnterToContinue();

es = blRef->unhighlight(subentPaths[0]);

acutPrintf("\nHighlighting the next face.");

es = blRef->highlight(subentPaths[1]);

pressEnterToContinue();

es = blRef->unhighlight(subentPaths[1]);

}

delete []subentPaths;

// Now, let’s highlight the whole entity.

//

acutPrintf("\nHighlighting the entire entity");

AcDbFullSubentPath subPath;

for (int i = count; i >= 0; i--) {

subPath.objectIds().append(idArray[i]);

}

es = blRef->highlight(subPath);

pressEnterToContinue();

es = blRef->unhighlight(subPath);

// Finally, let’s highlight each enclosing

// insert.

//

for (i = count -1; i >= 0; i --) {

subPath.objectIds().removeAt(

subPath.objectIds().length() - 1);

acutPrintf("\nHighlighting insert layer %d",

i + 1);

blRef->highlight(subPath);

pressEnterToContinue();

es = blRef->unhighlight(subPath);

}

} // case RTNORM

break;

case RTNONE:

case RTCAN:

return;

default:

continue;

} // switch

break;

} //for (;;)

AOK(ent->close());

AOK(ent2->close());

return;

}




Содержание  Назад  Вперед