用ARX创建线型
问题:
How can I create a linetype using ARX?
解答:
The sample code below creates a linetype using ARX:
#include "dbmain.h"
#include "dbsymtb.h"
void utilsarxtest () {
AcDbLinetypeTable *pLtypeTable =NULL ;
// get the linetype table from the drawing
if ( acdbHostApplicationServices()->workingDatabase()->getLinetypeTable (pLtypeTable, AcDb::kForWrite) ==
Acad::eOk ) {
AcDbLinetypeTableRecord *pLtypeTableRecord =new
AcDbLinetypeTableRecord ;
// set all of the properties of the linetype table record.
pLtypeTableRecord->setAsciiDescription ("T E S T -") ;
pLtypeTableRecord->setPatternLength (0.75) ;
pLtypeTableRecord->setNumDashes (2) ;
pLtypeTableRecord->setDashLengthAt (0, 0.5) ;
pLtypeTableRecord->setDashLengthAt (1,-0.25) ;
pLtypeTableRecord->setName ("ASTESTER") ;
AcDbObjectId tmpId ;
// add the pLtypeTableRecord to the linetype table
if (pLtypeTable->add (tmpId, pLtypeTableRecord)==Acad::eOk){
pLtypeTableRecord->close () ;
} else {
delete pLtypeTableRecord ;
}
// close everything up
pLtypeTable->close () ;
}
}
点赞~~~~~~~~~~~ 点赞
{:1_7:}{:1_3:}{:1_3:}{:1_3:}{:1_3:} 初学者学习{:1_1:}{:1_1:}{:1_1:}{:1_1:}{:1_1:}{:1_1:} 学习学习。。。。。。。。。。。。。。。 谢谢楼主分享。。。。。。。。。。。。。。。。。。。。。。。。
页:
[1]