CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

创建新图层

2023-1-1 07:23| 发布者: admin| 查看: 462| 评论: 0|来自: AutoCAD

以下代码从数据库中获取图层符号表,创建新的图层表记录,并将其命名为 (ASDK_MYLAYER)。然后将图层表记录添加到图层表中。

void
createNewLayer()
{
    AcDbLayerTable *pLayerTable;
    acdbHostApplicationServices()->workingDatabase()
        ->getSymbolTable(pLayerTable, AcDb::kForWrite);
    AcDbLayerTableRecord *pLayerTableRecord =
        new AcDbLayerTableRecord;
    pLayerTableRecord->setName("ASDK_MYLAYER");
    // Defaults are used for other properties of 
    // the layer if they are not otherwise specified.
    //
    pLayerTable->add(pLayerTableRecord);
    pLayerTable->close();
    pLayerTableRecord->close();
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 13:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部