明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2956|回复: 2

如何添加线型?

[复制链接]
发表于 2002-8-14 14:34 | 显示全部楼层 |阅读模式
我要使用中心线绘图,但是没办法加载这个线型,哪为高手指点一二
发表于 2002-8-15 08:52 | 显示全部楼层

参考一下

void TUFUDLG::CreatLineType() { //创建线型
        AcDbLinetypeTable *pLinetypeTable;//线型
        AcDbObjectId ltId;
        acdbHostApplicationServices()->workingDatabase()
                ->getSymbolTable(pLinetypeTable,AcDb::kForWrite);
        AcDbLinetypeTableRecord *pLinetypeTableRec=new AcDbLinetypeTableRecord;
        pLinetypeTableRec->setName("中心线");
        pLinetypeTableRec->setAsciiDescription("中心线____ _ ____");
        pLinetypeTableRec->setNumDashes(4);
        pLinetypeTableRec->setDashLengthAt(0,1.25);
        pLinetypeTableRec->setDashLengthAt(1,-0.25);
        pLinetypeTableRec->setDashLengthAt(2,0.25);
        pLinetypeTableRec->setDashLengthAt(3,-0.25);
        pLinetypeTableRec->setIsScaledToFit(0);
        pLinetypeTableRec->setPatternLength(2);
        pLinetypeTable->add(pLinetypeTableRec);
        pLinetypeTableRec->close();
    AcDbLinetypeTableRecord *pLinetypeTableRec1=new AcDbLinetypeTableRecord;
        pLinetypeTableRec1->setName("虚线");
        pLinetypeTableRec1->setAsciiDescription("虚线__ __ __");
        pLinetypeTableRec1->setNumDashes(2);
        pLinetypeTableRec1->setDashLengthAt(0,0.5);
        pLinetypeTableRec1->setDashLengthAt(1,-0.25);
        pLinetypeTableRec1->setIsScaledToFit(0);
        pLinetypeTableRec1->setPatternLength(0.75);
        pLinetypeTable->add(pLinetypeTableRec1);
    pLinetypeTableRec1->close();
    AcDbLinetypeTableRecord *pLinetypeTableRec2=new AcDbLinetypeTableRecord;
        pLinetypeTableRec2->setName("双点划线");
        pLinetypeTableRec2->setAsciiDescription("双点划线____ _ _ ____");
        pLinetypeTableRec2->setNumDashes(6);
    pLinetypeTableRec2->setDashLengthAt(0,1.25);
        pLinetypeTableRec2->setDashLengthAt(1,-0.25);
        pLinetypeTableRec2->setDashLengthAt(2,0.25);       
        pLinetypeTableRec2->setDashLengthAt(3,-0.25);
        pLinetypeTableRec2->setDashLengthAt(4,0.25);
        pLinetypeTableRec2->setDashLengthAt(5,-0.25);
        pLinetypeTableRec2->setIsScaledToFit(0);
        pLinetypeTableRec2->setPatternLength(2.5);                       
        pLinetypeTable->add(pLinetypeTableRec2);
        pLinetypeTableRec2->close();
        pLinetypeTable->close();
        }
 楼主| 发表于 2002-8-15 15:12 | 显示全部楼层

Velen danke!

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-17 17:49 , Processed in 0.171852 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表