- 积分
- 13643
- 明经币
- 个
- 注册时间
- 2022-2-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
 - static void TaoDemoGetMinRectangle()
- {
- AcDbObjectIdArray polyIdArray;
- if(CPromptSelectEx::PromptSelectEnts(L"\n请拾取曲线:", AcDbCurve::desc(), polyIdArray, true))
- {
- AcDbCurve* pCurve = NULL;
- AcGeCurve3d * pGeCurve = NULL;
- AcGePoint3d base;
- AcGeVector3d dir1, dir2, dir3;
- AcGePoint3dArray ptArray;
- ptArray.setLogicalLength(4);
- for (const auto& id : polyIdArray)
- {
- if (Acad::eOk == acdbOpenObject(pCurve, id, AcDb::kForRead))
- {
-
- if(Acad::eOk == pCurve->getAcGeCurve(pGeCurve))
- {
- auto obb = pGeCurve->boundBlock();
- obb.get(base, dir1, dir2, dir3);
- ptArray[0] = base;
- ptArray[1] = base + dir1;
- ptArray[2] = base + dir2 + dir1;
- ptArray[3] = base + dir2;
- CDbPolylineEx::Add3dPolyline(ptArray, AcDb::k3dSimplePoly, true, 1);
- auto aabb = pGeCurve->orthoBoundBlock();
- aabb.get(base, dir1, dir2, dir3);
- ptArray[0] = base;
- ptArray[1] = base + dir1;
- ptArray[2] = base + dir2 + dir1;
- ptArray[3] = base + dir2;
- CDbPolylineEx::Add3dPolyline(ptArray, AcDb::k3dSimplePoly, true, 2);
- }
- pCurve->close();
- }
- }
- }
- }
|
|