length函数获取表长度
(length '("M20" "M24" "M30"))
获取第i个元素
(nth i list)
修改第i个元素
这里要求对象是点表。点表的形式:
((1. 12) (2. 32) (8. 77))
定义点表的方法:
(setq c (cons 1 12))
(setq clist '((cons 1 12) (cons 8 7))
获取点表中某一元素,然后替换:
(setq old (assoc 8 clist))
(setq new (cons 8 18))
(setq clist (subst new old clist))
参考来源: http://www.afralisp.net/autolisp/tutorials/list-manipulation.php