马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 Lispboy 于 2018-11-18 15:32 编辑
 - (defun c:xdtb_crv3tarc (/ _pick g1 e g-1 g-2 g-3 d1 d2 d3 garc)
- (defun _pick (no / g1)
- (setq tf t)
- (while (and (not g1)
- (setq e (xdrx_entsel
- (xdrx_prompt
- "\n拾取"
- (cond ((= no 1) "弧线起始线")
- ((= no 2) "弧线终止线")
- ((= no 3) "弧顶相切线")
- )
- "<退出>:"
- t
- )
- '((0 . "*polyline,line"))
- )
- )
- )
- (setq pt (cadr e)
- e (car e)
- )
- (cond ((xdrx_object_iskindof e "*polyline")
- (if (setq g1 (xdrx_polyline_getlinesegat
- e
- (xdrx_polyline_onsegat e pt)
- t
- )
- )
- (setq g1 (list g1 (xdge::getpropertyvalue g1 "paramof" pt) e))
- )
- )
- (t
- (setq g1 (xdge::constructor e))
- (setq g1 (list g1 (xdge::getpropertyvalue g1 "paramof" pt) e))
- )
- )
- (if (not g1)
- (xdrx_prompt "\n >>没有选到直线段,重试.."))
- )
- g1
- )
- (xdrx_begin)
- (if (and (setq d1 (_pick 1))
- (setq d2 (_pick 2))
- (setq d3 (_pick 3))
- )
- (progn (setq g-1 (xdge::entity:3d->2d (car d1))
- g-2 (xdge::entity:3d->2d (car d2))
- g-3 (xdge::entity:3d->2d (car d3))
- )
- (setq garc (xdge::constructor "kcircarc2d"))
- (if (xdge::setpropertyvalue
- garc
- "set"
- g-1
- g-2
- g-3
- (cadr d1)
- (cadr d2)
- (cadr d3)
- )
- (progn (if (and (setq int1
- (car (xdrx_entity_intersectwith (car d1) garc 3))
- )
- (setq int2
- (car (xdrx_entity_intersectwith (car d2) garc 3))
- )
- (setq int3
- (car (xdrx_entity_intersectwith (car d3) garc 3))
- )
- )
- (progn
- (setq g (xdge::constructor "kcircarc3d" int1 int3 int2))
- (xdge::entity:make g)
- (xdrx_entity_matchprop e (entlast)))
- )
- )
- (xdrx_prompt "\n >>所选三线不能构造切弧...")
- )
- )
- )
- (xdrx_end)
- (princ)
- )
|