大神帮忙看下
(defun c:ddd()
(setvar "cmdecho" 0)
(setq pt (getpoint "\n 选择标注基点平齐点"))
(setq ptx (car pt))
(setq pty (cadr pt))
(command "DIMLINEAR")
(setq en (entlast))
(setq zongbiao (entgeten))
(setq oldzibiao1 (assoc 13 zongbiao))
(setq oldzibiao2 (assoc 14 zongbiao))
(setq pt1 (cdr oldzibiao1))
(setq pt2 (cdr oldzibiao2))
(setq pt1X1 (car pt1))
(setq pt1Y1 (cadr pt1))
(setq pt2X1 (car pt2))
(setq pt2Y1 (cadr pt2))
(setq newpt1(listpt1X1pty (caddr pt1)))
(setq newpt2(listpt2X1pty (caddr pt2)))
(setq newzibiao1 (cons 13 newpt1 ))
(setq newzibiao2 (cons 14 newpt2 ))
(setq zongbiao (subst newzibiao1oldzibiao2zongbiao ))
(setq zongbiao (subst newzibiao2oldzibiao2zongbiao ))
(entmod zongbiao)
(prin1)
)
(defun c:ddd(/ en newpt1 newpt2 newzibiao1 newzibiao2 oldzibiao1 oldzibiao2 pt pt1 pt1x1 pt1y1 pt2 pt2x1 pt2y1 ptx pty zongbiao)
(setvar "cmdecho" 0)
(setq pt (getpoint "\n 选择标注基点平齐点:"))
(setq ptx (car pt))
(setq pty (cadr pt))
(command "DIMLINEAR")
(while (not (zerop (getvar "cmdactive")))(command pause))
(setq en (entlast))
(setq zongbiao (entget en))
(setq oldzibiao1 (assoc 13 zongbiao))
(setq oldzibiao2 (assoc 14 zongbiao))
(setq pt1 (cdr oldzibiao1))
(setq pt2 (cdr oldzibiao2))
(setq pt1X1 (car pt1))
(setq pt1Y1 (cadr pt1))
(setq pt2X1 (car pt2))
(setq pt2Y1 (cadr pt2))
(setq newpt1 (list pt1X1 pty (caddr pt1)))
(setq newpt2 (list pt2X1 pty (caddr pt2)))
(setq newzibiao1 (cons 13 newpt1))
(setq newzibiao2 (cons 14 newpt2))
(setq zongbiao (subst newzibiao1 oldzibiao1 zongbiao))
(setq zongbiao (subst newzibiao2 oldzibiao2 zongbiao))
(entmod zongbiao)
(princ)
) 多谢,后面有一处错误,还有局部变量,帮忙改了,能不能解释一下 (while (not (zerop (getvar "cmdactive")))(command pause))
页:
[1]