马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
使用AcGe几何库可以很方便的得到,使用ARX AcGeCircArc3d类的set方法
AcGeCircArc3d & set( const AcGeCurve3d& curve1, const AcGeCurve3d& curve2, double radius, double& param1, double& param2, Adesk::Boolean& success); curve1 | Input any 3D curve | curve2 | Input any 3D curve | radius | Input radius of arc | param1 | Input parameter value on curve1 where arc touches curve | param2 | Input parameter value on curve2 where arc touches curve | success | Output to indicate whether the arc was computed successfully | Changes the definition of the arc to be tangent to the two input curves and have the specified radius. The two input curves must be coplanar. This function always returns an arc whose endpoints are the points on the two input curves that correspond to param1 and param2. If this function returns a value for success that is Adesk::kFalse, then this function has not changed the object.
下面是XDRX API的LISP实现代码:
- (defun c:tt ()
- (if (setq r (getreal "\n输入半径:"))
- (progn
- (while (and
- (setq e1 (xdrx_entsel
- "\n拾取曲线1<退出>:"
- '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))
- )
- )
- (setq e2 (xdrx_entsel
- "\n拾取曲线2<退出>:"
- '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))
- )
- )
- )
- (if (and
- (setq p1 (cadr e1))
- (setq e1 (car e1))
- (setq p2 (cadr e2))
- (setq e2 (car e2))
- (setq g1 (xdge::constructor e1));构建曲线1几何对象
- (setq g2 (xdge::constructor e2));构建曲线2几何对象
- (setq pa1 (xdge::getpropertyvalue g1 "paramof" p1));曲线1上拾取点的参数值
- (setq pa2 (xdge::getpropertyvalue g2 "paramof" p2));曲线2上拾取点的参数值
- (setq garc (xdge::constructor "kcircarc3d"));构建AcGeCircArc3d对象
- (xdge::setpropertyvalue garc "set" g1 g2 r pa1 pa2);set方法,成功修改garc到公切圆弧
- )
- (progn
- (xdge::entity:make garc);生成数据库圆弧实体
- (xdrx_setpropertyvalue (entlast) "color" 2);设置颜色2
- )
- )
- (xdge::free g1 g2 garc);释放创建的几何对象
- )
- )
- )
- (princ)
- )
|