ObjectArx学习笔记-获取某一图层上所有直线
来源:互联网 发布:html js报错 编辑:程序博客网 时间:2024/06/03 16:52
//-----------------------------------------------------------------------------//----- acrxEntryPoint.h//-----------------------------------------------------------------------------#include "StdAfx.h"#include "resource.h"#include "dbsymtb.h"//-----------------------------------------------------------------------------#define szRDS _RXST("qxzy")//-----------------------------------------------------------------------------//----- ObjectARX EntryPointclass CGetEntsOnLayerApp : public AcRxArxApp {public:CGetEntsOnLayerApp () : AcRxArxApp () {}virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {// TODO: Load dependencies here// You *must* call On_kInitAppMsg hereAcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;// TODO: Add your initialization code herereturn (retCode) ;}virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {// TODO: Add your code here// You *must* call On_kUnloadAppMsg hereAcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;// TODO: Unload dependencies herereturn (retCode) ;}virtual void RegisterServerComponents () {}public:// - qxzyGetEntsOnLayer._GetEntsOnLayer command (do not rename)static void qxzyGetEntsOnLayer_GetEntsOnLayer(void){// Add your code for command qxzyGetEntsOnLayer._GetEntsOnLayer hereAcDbLayerTable *pLayerTbl;acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pLayerTbl,AcDb::kForRead);if(!pLayerTbl->has(_T("测试"))){acutPrintf(_T("\n当前图形中未包含\"测试\"图层!"));pLayerTbl->close();return;}AcDbObjectId layerId;pLayerTbl->getAt(_T("测试"),layerId);pLayerTbl->close();AcDbBlockTable *pBlkTbl;acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlkTbl, AcDb::kForRead);AcDbBlockTableRecord *pBlkTblRcd;pBlkTbl->getAt(ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForRead);pBlkTbl->close();AcDbBlockTableRecordIterator *pltr;pBlkTblRcd->newIterator(pltr);AcDbEntity *pEnt;for(pltr->start();!pltr->done();pltr->step()){pltr->getEntity(pEnt, AcDb::kForWrite);if(pEnt->layerId() == layerId){//whether it's a lineAcDbLine *pLine = AcDbLine::cast(pEnt);if(pLine != NULL);{pLine->setColorIndex(1);}}pEnt->close();}delete pltr;pBlkTblRcd->close();}} ;//-----------------------------------------------------------------------------IMPLEMENT_ARX_ENTRYPOINT(CGetEntsOnLayerApp)ACED_ARXCOMMAND_ENTRY_AUTO(CGetEntsOnLayerApp, qxzyGetEntsOnLayer, _GetEntsOnLayer, GetEntsOnLayer, ACRX_CMD_TRANSPARENT, NULL)
0 0
- ObjectArx学习笔记-获取某一图层上所有直线
- ObjectARX学习笔记(八)----中如何创建直线AcDbLine
- ObjectARX-学习笔记
- ObjectARX-学习笔记
- ObjectARX学习笔记
- ObjectArx学习笔记-画线
- ObjectArx学习笔记-acedGetXXX
- ObjectArx学习笔记-创建多段线
- ObjectARX学习笔记(二十二)--如何获取模型空间中最小点和最大点
- ObjectARX 获取指定一个图层中的所有实体
- ObjectARX学习笔记(十一)----创建圆弧AcDbArc
- ObjectArx学习笔记-Object 2013 Wizard问题解决
- ObjectArx学习笔记-画线并修改颜色
- ObjectArx学习笔记-设置字体样式
- ObjectArx学习笔记-创建标注样式
- ObjectArx学习笔记-UCS创建及应用
- ObjectArx学习笔记-Object 2013 Wizard问题解决
- ObjectARX学习笔记(一)----中如何根据组名将组里的所有实体删除,以及清除组
- TOMCAT内存溢出及大小调整
- smail指令参考
- 浅谈SQL Server中的三种物理连接操作(HASH JOIN MERGE JOIN NESTED LOOP)
- Eclipse 运行崩溃 报错 Failed to write core dump. Minidumps are not enabled by default on client versions解决
- 条款13:以对象管理资源
- ObjectArx学习笔记-获取某一图层上所有直线
- 信息论的熵
- 端口查看开启和禁用的方法
- 大家好啊!
- 汇博面试题片段
- html中的电话号码
- Android Camera存图片到SD卡 及时更新的问题
- Nginx的各种配置
- 国学经典成就李白 《孟子》之类读本要早读