马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 newer 于 2017-3-10 13:20 编辑
- (defun c:tt ()
- (xdrx_begin)
- (if (setq ss (ssget ":E:S" '((0 . "CIRCLE,ARC"))))
- (progn
- (setq cir (ssname ss 0)
- gcir (xdge::constructor cir)
- gPL (xdge::constructor "kCompositeCrv3d")
- )
- (xdge::setpropertyvalue gPl "setcurvelist" gcir)
- (xdge::entity:make gPl)
- (xdrx_entity_setpropertiesfrom (entlast) cir)
- (xdrx_setpropertyvalue (entlast) "constantwidth" 50.0)
- )
- )
- (xdrx_end)
- (princ)
- )
下面代码是反操作,多段线圆(弧)转成 圆(弧)
- (defun c:tt ()
- (xdrx_begin)
- (if (and (setq ss (ssget ":E:S" '((0 . "LWPOLYLINE"))))
- (setq cir (ssname ss 0))
- (xdrx_getpropertyvalue cir "hasbulges")
- (setq bulges (xdrx_getpropertyvalue cir "bulges"))
- )
- (progn
- (setq gcir (xdge::constructor cir)
- gPLs (xdge::getpropertyvalue gcir "getcurvelist")
- )
- (if (and (= (length bulges) 2)
- (equal (abs (apply '* bulges)) 1.0 1e-3)
- )
- (progn
- (xdge::getpropertyvalue (car gpls) "center" "radius")
- (xdrx_circle_make #center #radius)
- (xdrx_entity_setpropertiesfrom (entlast) cir)
- )
- (progn
- (mapcar
- '(lambda (x)
- (if (xdge::iskindof x "kCircArc3d")
- (progn (xdge::entity:make x)
- (xdrx_entity_setpropertiesfrom (entlast) cir)
- )
- )
- )
- gPLs
- )
- )
- )
- (xdrx_entity_delete cir)
- )
- )
- (xdrx_end)
- (princ)
- )
|