好的,这里有一个dwg,附有一个带有剪裁平面的命名视图。将视图设置为当前视图,然后选择一个iso视图将其恢复,您将看到裁剪平面裁剪出一些细节。
将下面的代码复制并粘贴到一个新的arx命令中,尝试取消对acedSetCurrentView的注释,看看会发生什么。
谢谢。
- // function to turn the clip planes off after being
- // in a clipped view. Use current view to change settings
- AcDbViewTable* pVt;
- acdbHostApplicationServices()->workingDatabase()
- ->getSymbolTable(pVt, AcDb::kForWrite);
- if (!pVt->has("CURRENT"))
- {
- AcDbViewTableRecord* pVtrec = new AcDbViewTableRecord;
- pVt->getAt("CURRENT", *&pVtrec,AcDb::kForWrite,false);
- struct resbuf rb;
- acedGetVar("TILEMODE", &rb);
- int tilemode = rb.resval.rint;
- acedGetVar("CVPORT", &rb);
- int cvport = rb.resval.rint;
- // Paperspace flag
- bool paperspace = ((tilemode == 0) && (cvport == 1)) ? Adesk::kTrue : Adesk::kFalse;
- pVtrec->setIsPaperspaceView(paperspace);
- if (Adesk::kFalse == paperspace)
- {
- pVtrec->setFrontClipEnabled(false);
- pVtrec->setBackClipEnabled(false);
- acutPrintf("\nDone:");
- }
- else
- {
- acutPrintf("\nCan't turn off clipping planes in paperspace!");
- }
- //acedSetCurrentView(pVtrec,NULL);//close();
- pVt->close();
-
- }
- else
- {
- pVt->close();
- acutPrintf("\nFailed to turn off clipping, try again:");
- }
|