谁帮给我个ObjectARX2002多段线简单的程序
谁帮给我个ObjectARX2002多段线简单的程序,不要MFC的程序,起点是0,0,终点是10,50的一条多段线。谢谢!!! 本帖最后由 BDYCAD 于 2012-10-3 22:29 编辑//支持涵数:
AcDbBlockTableRecord *GetModelSpace(AcDb::OpenMode Mode){
AcDbDatabase *pDwg = acdbHostApplicationServices()->workingDatabase();
AcDbBlockTable *pBlockTable;
AcDbBlockTableRecord *pModelSpace;
pDwg->getSymbolTable(pBlockTable, AcDb::kForRead);
pBlockTable->getAt(ACDB_MODEL_SPACE, pModelSpace, Mode);
pBlockTable->close();
return pModelSpace;
}
//生成PLINE程序示例:
AcDbObjectId PlineID;
AcGePoint2d Spt(0,0),Ept(10,50);
AcGePoint2dArray PointList;
PointList.append(Spt);
PointList.append(Ept);
int PNumber=PointList.length();
AcDbBlockTableRecord *pModelSpace =GetModelSpace(AcDb::kForWrite);
AcDbPolyline *newEnt=new AcDbPolyline(PNumber);
for(int i=0;PNumber>i;i++){
Spt=PointList.at(i);
newEnt->addVertexAt(i,Spt);
}
pModelSpace->appendAcDbEntity(PlineID,newEnt);
//if (ClosedObj==TRUE)newEnt->setClosed(Adesk::kTrue);//封闭LWPOLYLINE
newEnt->close();
pModelSpace->close(); BDYCAD 发表于 2012-10-3 22:28 static/image/common/back.gif
谢谢!非常感谢
BDYCAD 发表于 2012-10-3 22:28 static/image/common/back.gif
int i=0;PNumber>i;i++){
如何将多段线 顶点编号 int定义到文字内容 const char*text 里面去 四楼的问题好象你发贴问了:
参考贴: http://bbs.mjtd.com/thread-96714-1-1.html
页:
[1]