当前位置:   article > 正文

objectARX 多线段 AcDbPolyline

acdbpolyline

AcDbPolyline 创建的是一个曲线,一个实体。

  1. static void MyGroupMyCommand6() {
  2. // Put your command code here
  3. acutPrintf(TEXT("\nHello world! make padding"));
  4. // 只读方式打开处于活动状态的图形数据库块表
  5. AcDbBlockTable *pTable;
  6. acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pTable, AcDb::kForRead);
  7. // 只写方式打开模型空间所在块表记录
  8. AcDbBlockTableRecord *pRecord;
  9. pTable->getAt(ACDB_MODEL_SPACE, pRecord, AcDb::kForWrite);
  10. AcGePoint3dArray points;
  11. points.append(AcGePoint3d(1000, 100, 0));
  12. points.append(AcGePoint3d(100, 1000, 0));
  13. points.append(AcGePoint3d(500, 500, 0));
  14. points.append(AcGePoint3d(1000, 100, 0));
  15. AcGePoint2dArray pt2ds;
  16. for (int i = 0; i < points.length(); i++)
  17. pt2ds.append(points[i].convert2d(AcGePlane::kXYPlane));
  18. //创建多段线
  19. AcDbPolyline* pPoly = new AcDbPolyline();
  20. for (int i = 0; i < pt2ds.length(); ++i)
  21. pPoly->addVertexAt(i, pt2ds[i]);
  22. pRecord->appendAcDbEntity(pPoly);
  23. pPoly->close();
  24. pRecord->close();
  25. pTable->close();
  26. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/114398?site
推荐阅读
相关标签
  

闽ICP备14008679号