本帖最后由 xyp1964 于 2024-2-2 13:51 编辑
- (defun abc (pl / ptn ptn1 ptn2 p1 p2 p3 p4)
- (setq ptn (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget pl)))
- ptn (vl-sort ptn '(lambda (x y) (> (cadr x) (cadr y))))
- )
- (mapcar 'set '(p1 p2 p3 p4) ptn)
- (setq ptn1 (vl-sort (list p1 p2) '(lambda (x y) (< (car x) (car y))))
- ptn2 (vl-sort (list p3 p4) '(lambda (x y) (< (car x) (car y))))
- )
- (append ptn1 ptn2)
- )
- (defun abc2 (pl / ptn pptn1 ptn2 p1 p2 p3 p4)
- (setq ptn (mapcar 'cdr(vl-remove-if '(lambda (x) (/= (car x) 10)) (entget pl)))
- ptn (vl-sort ptn '(lambda (x y) (< (car x) (car y))))
- )
- (mapcar 'set '(p1 p2 p3 p4) ptn)
- (setq ptn1 (vl-sort (list p1 p2) '(lambda (x y) (> (cadr x) (cadr y))))
- ptn2 (vl-sort (list p3 p4) '(lambda (x y) (> (cadr x) (cadr y))))
- )
- (list (car ptn1) (car ptn2) (cadr ptn1) (cadr ptn2))
- )
|