CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

创建新图层

2024-5-18 17:56| 发布者: admin| 查看: 92| 评论: 0|原作者: admin|来自: 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   苏公网安备32011402011833)

GMT+8, 2025-3-5 17:53

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部