啵浪鼓 发表于 2013-9-1 03:06
ll_j老师再帮一下吧,上次的表合成后,相同坐标仍然要合并成组才行,将您的代码改动了许久,也改不了,老出现如 ...
- (defun tt1 (lst)
- (if lst
- (cons
- (append
- (apply 'append ;建议这里的append换成list
- (mapcar
- '(lambda (y)
- (reverse (cdr (reverse y))) ;去掉最后一个元素
- )
- (vl-remove-if-not
- '(lambda (x)
- ; (equal (last x) (last (car lst))) ;对最后一个元素判别,可以不是点
- (equal (distance (last x) (last (car lst))) 0 1e-6) ;最后一个元素是点
- )
- lst
- )
- )
- )
- (list (last (car lst)))
- )
- (tt1 (vl-remove-if
- '(lambda (x)
- ; (equal (last x) (last (car lst)))
- (equal (distance (last x) (last (car lst))) 0 1e-6)
- )
- lst
- )
- )
- )
- )
- )
(setq lst '(((("1" "22") . 1) <图元名:7EDF45C0> (5153.5 4047.6 0.0))
((("2" "33") . 1) <图元名:7EDF45B8> (5153.5 4047.6 0.0))
((("3" "05") . 2) <图元名:7EDF45B0> <图元名:7EDF46B0> (5128.3 4047.9 0.0))
((("5" "xx") . 1) <图元名:7EDF45A8> (5128.3 4047.9 0.0))
)
)
命令: (tt1 lst)
(((("1" "22") . 1) <图元名:7EDF45C0> (("2" "33") . 1) <图元名:7EDF45B8> (5153.5
4047.6 0.0)) ((("3" "05") . 2) <图元名:7EDF45B0> <图元名:7EDF46B0> (("5" "xx") . 1)
<图元名:7EDF45A8> (5128.3 4047.9 0.0)))
|