为什么用entmod无法执行?
兄弟们,帮忙看一下,为什么把 entmake 换成 entmod无法执行,提示 “参数太多”?[*](defun c:tt(/ en endata entype)
[*](setq ss(ssget '((0 . "LINE"))))
[*] (setq i 0)
[*] (repeat (sslength ss)
[*] (setq en(ssname ss i))
[*] (setq endata(entget en))
[*] (setq pt1 (assoc 10 endata))
[*] (setq pt2 (assoc 11 endata))
[*] (setq pt1y (caddr pt1))
[*] (princ pt1y)
[*] (princ "\n")
[*] (setq pt2x (cadr pt2))
[*] (princ pt2x)
[*] (princ "\n")
[*] (entmake (list '(0 . "LINE") pt1 (cons 11 (list pt2x pt1y))))
[*] (entdel en)
[*];;;;;;;; (entmod (subst (cons 11 (list pt2x pt1y) (assoc 11 endata) endata)));;;;;; 用这句话为什么不可以?
[*] (setq i (1+ i))
[*])
[*] (princ)
[*])
(defun c:tt(/ en endata entype)
(setq ss(ssget '((0 . "LINE"))))
(setq i 0)
(repeat (sslength ss)
(setq en(ssname ss i))
(setq endata(entget en))
(setq pt1 (assoc 10 endata))
(setq pt2 (assoc 11 endata))
(setq pt1y (caddr pt1))
(princ pt1y)
(princ "\n")
(setq pt2x (cadr pt2))
(princ pt2x)
(princ "\n")
;;; (entmake (list '(0 . "LINE") pt1 (cons 11 (list pt2x pt1y))))
;;; (entdel en)
(entmod (subst (cons 11 (list pt2x pt1y 0)) (assoc 11 endata)endata)) ;;;;;; 用这句话为什么不可以?
(setq i (1+ i))
)
(princ)
) tigcat 发表于 2023-4-3 21:01
(defun c:tt(/ en endata entype)
(setq ss(ssget '((0 . "LINE"))))
(setq i 0)
感谢,感谢! ENTMOD最大的一个前提,-1组指定的图元名代码表的图元还存在。。。 (cons 11 (list pt2x pt1y)改成
(cons 11 (list pt2x pt1y0.0)是不是这样呢?我觉得应该坐标三个点,再加上11
具体我没仔细研究
页:
[1]