magicheno 发表于 2020-8-10 14:40:54

start4444 发表于 2020-8-10 12:58
你的代码没有对新画线修改48码,在修改8码那里加上去就对了

大侠再请教下,如果我想绘制出来的是无缝断开的线段的话,该如何结合呢,下面是上次你帮忙写的,想两者结合一下,目的是我绘制出来的多段线是一段一段的
(defun c:tt5 (/ entname w)
(setvar "PEDITACCEPT" 1)
(setq entname (car (entsel "\n请选择对象:")) w (cdr (assoc 40 (entget entname))))         
(command "EXPLODE" entname "" "pedit" "m" "p" "" "w" w "")
(setvar "PEDITACCEPT" 0)
(princ)
)

start4444 发表于 2020-8-10 16:49:12

magicheno 发表于 2020-8-10 14:40
大侠再请教下,如果我想绘制出来的是无缝断开的线段的话,该如何结合呢,下面是上次你帮忙写的,想两者结 ...

在你代码最后一个括号前面加下面一段:

(wufengduankai (cdr (assoc -1 ss)))

(defun wufengduankai (entname / w)
(setvar "PEDITACCEPT" 1)
(setq w (cdr (assoc 40 (entget entname))))         
(command "EXPLODE" entname "" "pedit" "m" "p" "" "w" w "")
(setvar "PEDITACCEPT" 0)
(princ)
)

magicheno 发表于 2020-8-10 17:11:31

start4444 发表于 2020-8-10 16:49
在你代码最后一个括号前面加下面一段:

(wufengduankai (cdr (assoc -1 ss)))


是这样么,好像不行呢
(command "pline" pause "w" "100" "100" pause)
(setq ss (entget (entlast)))
(setq oldlayer (assoc 8 ss))
(setq newlayer (cons 8 "WP_YY_CHG" ))
(setq newlayer (cons 48 0.6))
(setq ss (subst newlayer oldlayer ss))
(entmod ss)

(wufengduankai (cdr (assoc -1 ss)))

(defun wufengduankai (entname / w)
(setvar "PEDITACCEPT" 1)
(setq w (cdr (assoc 40 (entget entname))))         
(command "EXPLODE" entname "" "pedit" "m" "p" "" "w" w "")
(setvar "PEDITACCEPT" 0)
(princ)
)
(princ)
)

magicheno 发表于 2020-8-10 17:51:23

magicheno 发表于 2020-8-10 17:11
是这样么,好像不行呢
(command "pline" pause "w" "100" "100" pause)
(setq ss (entget ( ...
(defun c:tt5 (/ ss oldlayer newlayer)
;;;创建图层
(command "layer" "m" "WP_YY_CHG" "c" "6" "" "")
(if (= (tblobjname "layer" "WP_YY_CHG") nil)
    (entmake
      (list
      '(0 . "LAYER")
      '(100 . "AcDbSymbolTableRecord")
      '(100 . "AcDbLayerTableRecord")
      '(70 . 0)
         (cons 2 "WP_YY_CHG")
         (cons 62 6)
         (cons 6 "PHANTOM2")


      )
    )
)



;;;绘制多段线并设置属性
(command "pline" pause "w" "100" "100" pause)
(setq ss (entget (entlast)))
(setq oldlayer (assoc 8 ss))
(setq newlayer (cons 8 "WP_YY_CHG" ))
(setq newlayer (cons 48 0.6))
(setq ss (subst newlayer oldlayer ss))
(entmod ss)

(wufengduankai (cdr (assoc -1 ss)))

(defun wufengduankai (entname / w)
(setvar "PEDITACCEPT" 1)
(setq w (cdr (assoc 40 (entget entname))))         
(command "EXPLODE" entname "" "pedit" "m" "p" "" "w" w "")
(setvar "PEDITACCEPT" 0)
(princ)
)
(princ)
)

start4444 发表于 2020-8-10 19:54:31

magicheno 发表于 2020-8-10 17:51
(defun c:tt5 (/ ss oldlayer newlayer)
;;;创建图层
(command "layer" "m" "WP_YY_CHG" "c" "6" "" "" ...

看看行不···

magicheno 发表于 2020-8-10 20:13:29

start4444 发表于 2020-8-10 19:54
看看行不···

可以的感谢大侠相助
页: 1 [2]
查看完整版本: 绘制多段线如何设置线段的线型比例