明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 982|回复: 4

[讨论] 删除表中元素

[复制链接]
发表于 2015-11-4 20:23 | 显示全部楼层 |阅读模式
(setq points (
                         (378499.0 43587.4 -1.65106e-056)
                         (378499.0 43587.4 -1.65106e-056)
                         (378499.0 43587.4 -1.65106e-056)
                         (378480.0 43587.4 -1.65106e-056)
                        ))

如何输出points为去除相同元素后的列表
发表于 2015-11-5 08:25 | 显示全部楼层
本帖最后由 USER2128 于 2015-11-5 08:44 编辑
  1. (setq points '((378499.0 43587.4 -1.65106e-056)
  2.                (378499.0 43587.4 -1.65106e-056)
  3.                (378499.0 43587.4 -1.65106e-056)
  4.                (378480.0 43587.4 -1.65106e-056)
  5.                ))
  6. ;;; 对点表进行X、Y、Z排序(此略).
  7. (setq tmp (mapcar '(lambda(x y) (if (equal x y) nil y))
  8.                   points (cdr points)))
  9. (setq tmp (vl-remove 'nil tmp))
  10. (setq tmp (cons (car points) tmp))
 楼主| 发表于 2015-11-5 10:18 | 显示全部楼层
USER2128 发表于 2015-11-5 08:25

points后面的列表不带标点符号’
发表于 2015-11-5 10:36 | 显示全部楼层
你从基本功抓起吧,如你不用',就用
(setq points (List (378499.0 43587.4 -1.65106e-056)
               (378499.0 43587.4 -1.65106e-056)
               (378499.0 43587.4 -1.65106e-056)
               (378480.0 43587.4 -1.65106e-056)
               ))
也行的。
 楼主| 发表于 2015-11-5 11:04 | 显示全部楼层
USER2128 发表于 2015-11-5 10:36
你从基本功抓起吧,如你不用',就用
(setq points (List (378499.0 43587.4 -1.65106e-056)
             ...

恩 好的 我在从基础学习 谢谢您了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-2 17:22 , Processed in 0.206964 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表