TA的每日心情 | 开心 昨天 06:36 |
---|
签到天数: 15 天 [LV.4]偶尔看看III
管理员
- 积分
- 1308
|
楼主 |
发表于 2024-3-16 09:25:10
|
显示全部楼层
- //当前项目中注册一个命令 MyCreateDimAligned
- static void MidasMyGroupMyCreateDimAligned()
- {
- CGeometryOper m采用geometryOper;
- // 指定起始点位置
- AcGePoint3d pt1(200, 160, 0);
- AcGePoint3d pt2= m采用geometryOper.RelativePoint(pt1, -40, 0);
- AcGePoint3d pt3 = m采用geometryOper.PolarPoint(pt2, 7 * m采用geometryOper.PI() / 6, 20);
- AcGePoint3d pt4 = m采用geometryOper.RelativePoint(pt3, 6, -10);
- AcGePoint3d pt5 = m采用geometryOper.RelativePoint(pt1, 0, -20);
- // 绘制外轮廓线
- CCreateEnt::CreateLine(pt1, pt2);
- CCreateEnt::CreateLine(pt2, pt3);
- CCreateEnt::CreateLine(pt3, pt4);
- CCreateEnt::CreateLine(pt4, pt5);
- CCreateEnt::CreateLine(pt5, pt1);
- // 绘制圆形
- AcGePoint3d ptCenter1, ptCenter2;
- ptCenter1 = m采用geometryOper.RelativePoint(pt3, 16, 0);
- ptCenter2 = m采用geometryOper.RelativePoint(ptCenter1, 25, 0);
- CCreateEnt::CreateCircle(ptCenter1, 3);
- CCreateEnt::CreateCircle(ptCenter2, 4);
-
- AcGePoint3d ptTemp1, ptTemp2;
- // 水平标注
- ptTemp1 = m采用geometryOper.RelativePoint(pt1, -20, 3);
- CCreateEnt::CreateDimRotated(pt1, pt2, ptTemp1, 0);
- // 垂直标注
- ptTemp1 = m采用geometryOper.RelativePoint(pt1, 4, 10);
- CCreateEnt::CreateDimRotated(pt1, pt5, ptTemp1,
- m采用geometryOper.PI() / 2);
- // 转角标注
- ptTemp1 = m采用geometryOper.RelativePoint(pt3, -3, -6);
- CCreateEnt::CreateDimRotated(pt3, pt4, ptTemp1, 7 * m采用geometryOper.PI() / 4);
- // 对齐标注
- ptTemp1 = m采用geometryOper.RelativePoint(pt2, -3, 4);
- CCreateEnt::CreateDimAligned(pt2, pt3, ptTemp1, AcGeVector3d(4, 10, 0), 采用T("new position"));
- // 角度标注
- ptTemp1 = m采用geometryOper.RelativePoint(pt5, -5, 5);
- CCreateEnt::CreateDim3PtAngular(pt5, pt1, pt4, ptTemp1);
- // 半径标注
- ptTemp1 = m采用geometryOper.PolarPoint(ptCenter1, m采用geometryOper.PI() / 4, 3);
- CCreateEnt::CreateDimRadial(ptCenter1, ptTemp1, -3);
- // 直径标注
- ptTemp1 = m采用geometryOper.PolarPoint(ptCenter2,
- m采用geometryOper.PI() / 4, 4);
- ptTemp2 = m采用geometryOper.PolarPoint(ptCenter2,
- m采用geometryOper.PI() / 4, -4);
- CCreateEnt::CreateDimDiametric(ptTemp1, ptTemp2, 0);
- // 坐标标注
- CCreateEnt::CreateDimOrdinate(ptCenter2, AcGeVector3d(0, -10, 0),
- AcGeVector3d(10, 0, 0));
- }
复制代码 |
|