如何添加线型?
我要使用中心线绘图,但是没办法加载这个线型,哪为高手指点一二参考一下
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();
}
Velen danke!
页:
[1]