求助,麻烦谁可以帮我修改一下这个lsp,把画单线变成画多段线的,谢谢
:::这个lsp是我在明经上面找的,找不到来源了,麻烦了,多谢,多谢(defun c:tt2(/ p1 p2 e dis )
(setvar 'cmdecho 0)
(vl-cmdf "line"(setq p1(getpoint"\n直线起点"))
(setq p2(getpoint p1"\n直线端点"))
""
)
(setq e(entlast))
(if *dis*
(setq dis (getdist (strcat"\n输入偏移距离<" (rtos *dis* 2 2)">")))
(setq dis (getdist (strcat"\n输入偏移距离<" ">")))
)
(if dis (setq *dis* dis)(setqdis *dis*))
(setq n 1)
(while(and(< n 3)(setq p1(getpoint"\n偏移方向")))
(if p1(vl-cmdf "offset" dis e p1 ""))
(setq n(1+ n))
)
(if (and(not p1)(< n 2))
(progn
(vla-offset (vlax-ename->vla-object e)dis)
(vla-offset (vlax-ename->vla-object e)(* -1 dis))
)
)
(princ)
)
(defun c:tt2(/ p1 p2 e dis )
(setvar 'cmdecho 0)
(command "_.pline" )
(while (= 1 (logand 1 (getvar 'cmdactive)))
(command "\\")
)
(setq e(entlast))
(if *dis*
(setq dis (getdist (strcat"\n输入偏移距离<" (rtos *dis* 2 2)">")))
(setq dis (getdist (strcat"\n输入偏移距离<" ">")))
)
(if dis (setq *dis* dis)(setqdis *dis*))
(setq n 1)
(while(and(< n 3)(setq p1(getpoint"\n偏移方向")))
(if p1(vl-cmdf "offset" dis e p1 ""))
(setq n(1+ n))
)
(if (and(not p1)(< n 2))
(progn
(vla-offset (vlax-ename->vla-object e)dis)
(vla-offset (vlax-ename->vla-object e)(* -1 dis))
)
)
(princ)
) tigcat 发表于 2024-7-3 00:13
(defun c:tt2(/ p1 p2 e dis )
(setvar 'cmdecho 0)
(command "_.pline" )
大腿,膜拜中:lol感谢。。。 路过,收藏!这个LISP适合拿来画道路、管道、之类的图示。 这个,不错,短小精悍
页:
[1]