我得到它确实移动c1,它不移动右下角的圆,这是(entlast)。
我误解了你在列表中添加项目的惯例,它最初确实添加了c1,因为它是第一个循环的“a”。但是当“entnext a”为nil时,循环停止,因此实际上无法将最后一项添加到列表中。我想
**编辑**
这个实体集合例程没有递归版本那么优雅,但似乎可以工作。此外,还修改了移动命令:
- (defun c:test ()
- (setq ss (ssadd))
- (command "_line" "0,5" "0,11" "")
- (setq l1 (entlast))
- (command "_circle" "0,5" "5")
- (setq c1 (entlast))
- (command "-array" l1 c1 "" "P" "0,0" "3" "" "Y")
- (setq eLst (Ent_List_to_End c1))
- (foreach n eLst (ssadd n ss))
- (command "_move" ss l1 "" pause pause)
- )
- (defun Ent_List_to_End(ent / a entlist)
-
- (while ent
- (setq entlist (cons ent entlist))
- (setq ent (entnext ent))
- )
- entlist
- )
|