- (defun c:lsp_48()
- (setvar "cmdecho" 0)
- (setq ffn (getfiled "选取文件" "" "doc" 1))
- (setq ff (open ffn "w"))
- (close ff)
- (princ "\n选取PLINE多义线...")
- (setq ss (ssget))
- (setq i 0)
- (setvar "pdmode" 33)
- (repeat (sslength ss)
- (setq ssn (ssname ss i))
- (setq endata (entget ssn))
- (setq n 0)
- (repeat (length endata)
- (setq pp (nth n endata))
- (setq key (car pp))
- (if (= key 10);;;;<FONT color=red>;他这里为什么要从属性列表中去一个个查找啊,为什么不直接assoc,
- </FONT>(progn ;;;<FONT color=red>;</FONT><FONT color=#ff0000>再者属性列表中有(10. x y z)这一个表,其他的顶点怎么找出来的呢?书上是说顶点坐标,多</FONT>(setq x (cadr pp));;;;;;;;;;;<FONT color=#ff0000>重项目,可我一句句加载,还是控制台中没有显示其他顶点啊???</FONT>
- (setq y (caddr pp))
- (command "point" (list x y))
- (setq ff (open ffn "a"))
- (princ x ff)
- (princ " " ff)
- (princ y ff)
- (princ "\n" ff)
- (close ff)
- )
- )
- (setq n (1+ n))
- )
- (setq ff (open ffn "a"))
- (princ "End\n" ff)
- (close ff)
- (setq i (1+ i))
- )
- (princ (strcat "\n文件写至=> " ffn))
- (prin1)
- )
问题见代码红色字体 求指教 例题来自《autolisp&dcl》11-47
|