柴月二号 发表于 2016-6-30 16:56:37

关于多段线的打断与合并

请教如何将 打断与合并的lisp源码合在一起,使打断一条多段线的同时   将打断的多段线合并
打断可直接用(command "break" pause "f" pause "@")
合并可使用 “jion”
请老师教我

柴月二号 发表于 2016-6-30 17:04:14

老师教我

xiaolong1487 发表于 2016-7-1 00:16:12

(defun c:ts (/ e en p pt)
      (while (setq p (getpoint))
                (progn
                        (cond
                              ((null (setq e (nentselp p)))
                                        (princ "\nPoint does not lie on an LWPolyline.")
                              )
                              ((= 4 (length e))
                                        (princ "\nObject is Nested.")
                                        (setq e nil)
                              )
                              ((/= "LWPOLYLINE" (cdr (assoc 0 (entget (setq en (car e))))))
                                        (princ "\nObject is not an LWPolyline.")
                                        (setq e nil)
                              )
                        )
                        (if (and e p en (setq pt (vlax-curve-getclosestpointto en (trans p 1 0))))
                              (progn
                                        (command "_.BREAK" e "F" pt "@")
                                        (command "_.pedit" (entlast) "j" en "" "")                        
                              )
                        )
                )
      )
)

柴月二号 发表于 2016-7-1 08:54:56

xiaolong1487 发表于 2016-7-1 00:16 static/image/common/back.gif


谢谢老师,完美解决
页: [1]
查看完整版本: 关于多段线的打断与合并