赞
踩
AcDbPolyline 创建的是一个曲线,一个实体。
- static void MyGroupMyCommand6() {
- // Put your command code here
- acutPrintf(TEXT("\nHello world! make padding"));
- // 只读方式打开处于活动状态的图形数据库块表
- AcDbBlockTable *pTable;
- acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pTable, AcDb::kForRead);
- // 只写方式打开模型空间所在块表记录
- AcDbBlockTableRecord *pRecord;
- pTable->getAt(ACDB_MODEL_SPACE, pRecord, AcDb::kForWrite);
-
- AcGePoint3dArray points;
- points.append(AcGePoint3d(1000, 100, 0));
- points.append(AcGePoint3d(100, 1000, 0));
- points.append(AcGePoint3d(500, 500, 0));
- points.append(AcGePoint3d(1000, 100, 0));
- AcGePoint2dArray pt2ds;
- for (int i = 0; i < points.length(); i++)
- pt2ds.append(points[i].convert2d(AcGePlane::kXYPlane));
- //创建多段线
- AcDbPolyline* pPoly = new AcDbPolyline();
- for (int i = 0; i < pt2ds.length(); ++i)
- pPoly->addVertexAt(i, pt2ds[i]);
- pRecord->appendAcDbEntity(pPoly);
-
- pPoly->close();
- pRecord->close();
- pTable->close();
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。