void CSSFiltrR::endSSGet(Acad::PromptStatus returnStatus, int ssgetFlags, AcEdSelectionSetService & service, const AcDbObjectIdArray& selectionSet)
{
//тут stage это флаг из
//void CDocManR::documentLockModeChanged(AcApDocument* pDoc, AcAp::DocLockMode myPreviousMode, AcAp::DocLockMode myCurrentMode, AcAp::DocLockMode currentMode, const ACHAR* //pGlobalCmdName)
//{
// if(_tcscmp(pGlobalCmdName,_T("#MATERIALOPERATION"))==0)
// {
// stage = 1;
// }
// AcApDocManagerReactor::documentLockModeChanged(pDoc,myPreviousMode,myCurrentMode,currentMode,pGlobalCmdName);
//}
if(stage==1)
{
for(int i = 0; i < selectionSet.length(); i++)
{
if(selectionSet.at(i).objectClass()->name() == AcDbHatch::desc()->name())
{
Acad::ErrorStatus es;
CString lr;
int clr = 0;
AcDbObjectPointer<AcDbHatch> pHatch(selectionSet.at(i),AcDb::kForRead);
if(pHatch.openStatus()==Acad::eOk)
{
AcDbRegion * pReg = pHatch->getRegionArea();
lr = pHatch->layer();
clr = pHatch->colorIndex();
pHatch->close();
AcDbObjectId surfId;
if(pReg!=NULL)
{
AcDbPlaneSurface * pMainSurf = new AcDbPlaneSurface();
pMainSurf->setLayer(lr);
pMainSurf->setColorIndex(clr);
pMainSurf->createFromRegion(pReg);
pMainSurf->setMaterial(materialId);
acDocManager->lockDocument(curDoc());
surfId = addToDataBase(pMainSurf);
acDocManager->unlockDocument(curDoc());
pMainSurf->close();
}
ads_name ename;
acdbGetAdsName(ename,surfId);
resbuf *pBuf = acutBuildList(RTLB,RTSHORT,0,RTENAME,ename,RTSHORT,0,RTLE,RTNONE);
es = service.remove(i);
es = service.add(pBuf);
acutRelRb(pBuf);
}
}
}
stage = 0;
}
AcEdSSGetFilter::endSSGet(returnStatus,ssgetFlags,service,selectionSet);
}