也不知道你上面的程序是哪儿抄来改的,,,这样可学不好,弄一个程序来至少要把它大致看明白了- (defun c:PL (/ str)
- (VL-LOAD-COM)
- (fen)
- (if zb
- (progn
- (command "_pline")
- (mapcar 'command zb)
- (command "")
- )
- )
- (princ)
- )(defun fen ()
- (setq b nil)
- (while (/= (setq a (getstring "输入点号:")) "")
- (setq b (append b (list a)))
- )
- (setq i 0 zb nil)
- (repeat (length b)
- (setq dianhao (nth i b))
- (setq ent (ssname (ssget "x" (list '(0 . "TEXT") (cons 1 dianhao))) 0))
- (setq sf (entget ent))
- (if (member dianhao b)
- (progn(setq zuobiao(cdr (assoc 10 sf)))
- (setq zbX(-(car zuobiao) 0.5))
- (setq zbY(+(car(cdr zuobiao)) 0.75))
- (setq zb(append zb (list (list zbX zbY))))
- )
- )
- (setq i (+ i 1))
- )
- zb
- )
|