马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
两个通用函数
- (defun _dxf (lst l)
- (mapcar 'cdr
- (if (eq (type l) 'INT)
- (vl-remove-if '(lambda (x) (/= (car x) l)) lst)
- (vl-remove-if '(lambda (x) (not (member (car x) l))) lst)
- )
- )
- )
- (defun _equal (l1 l2)
- (not (vl-some '(lambda (a b)
- (not (equal a b 1e-9))
- )
- l1
- l2
- )
- )
- )
ARC CIRCLE ELLIPSE PLINE

- (defun arc_eq (a1 a2 / e1 e2)
- (and (setq e1 (entget a1))
- (setq e2 (entget a2))
- (_equal (_dxf e1 '(40 50 51)) (_dxf e2 '(40 50 51)))
- )
- )
- (defun circle_eq (c1 c2 /)
- (equal (cdr (assoc 40 (entget c1))) (cdr (assoc 40 (entget c2)))
- 1e-6
- )
- )
- (defun pline_eq (pl1 pl2 / e1 e2 ptl)
- (and (eq (vlax-curve-isclosed pl1) (vlax-curve-isclosed pl2))
- (eq (vlax-curve-getendparam pl1)
- (vlax-curve-getendparam pl2)
- )
- (setq e1 (entget pl1))
- (setq e2 (entget pl2))
- (_equal (_dxf e1 '(40 41 42)) (_dxf e2 '(40 41 42)))
- (setq ptl (mapcar '(lambda (a b) (mapcar '- a b))
- (_dxf e1 10)
- (_dxf e2 10)
- )
- )
- (_equal ptl ptl)
- )
- )
- (defun ellipse_eq (e1 e2)
- (_equal (_dxf (entget e1) '(11 40 41 42))
- (_dxf (entget e2) '(11 40 41 42))
- )
- )
|