付费:点两条直线或多义线在这两条线的交点产生一个点
不需要那条线,点两下出现箭头处的点(就需要那个点),点的样式按系统的设定。有意的联系我(小东西不要天价)qq:1016768907;试用以下程序
(defun c:qjd()
(vl-load-com)
(setq cmd (getvar "cmdecho"))
(setq osm (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "_undo" "be")
(if (and
(princ "\n请选取第1条线:")
(setq ssa (ssget ":S" '((0 . "line,lwpolyline"))))
(princ "\n请选取第2条线:")
(setq ssb (ssget ":S" '((0 . "line,lwpolyline"))))
)
(progn
(setq obja (vlax-ename->vla-object (ssname ssa 0)))
(setq objb (vlax-ename->vla-object (ssname ssb 0)))
(setq jdb (vl-catch-all-apply 'vlax-invoke (list obja "intersectwith" objb acExtendBoth)))
(if (not (vl-catch-all-error-p jdb))
(progn
(setq pt (list (car jdb) (cadr jdb)))
(command "_point" pt)
(command "_chprop" (entlast) "" "c" 1 "")
(command "_circle" pt 1)
(command "_chprop" (entlast) "" "c" 1 "")
)
(alert "求交点出错!")
)
)
)
(command "_undo" "e")
(setvar "osmode" osm)
(setvar "cmdecho" cmd)
(princ)
) yshf 发表于 2019-8-15 19:28
;试用以下程序
(defun c:qjd()
(vl-load-com)
谢谢热心的坛友。 谢谢上面热心的坛友。 刚好看到一个类似的 http://bbs.mjtd.com/forum.php?mod=viewthread&tid=77085&extra=&highlight=%BD%BB%B5%E3&page=1 djjeson 发表于 2019-8-23 17:33
刚好看到一个类似的 http://bbs.mjtd.com/forum.php?mod=viewthread&tid=77085&extra=&highlight=%BD%BB%B5 ...
谢谢,我买了一个,你要的话可以艾特我。 不知道哪位热心人能否帮忙把圆半径1改为提示输入的数值? sunny_8848 发表于 2019-12-3 15:08
不知道哪位热心人能否帮忙把圆半径1改为提示输入的数值?
(defun c:qjd()
(vl-load-com)
(setq cmd (getvar "cmdecho"))
(setq osm (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "_undo" "be")
(if (and
(princ "\n请选取第1条线:")
(setq ssa (ssget ":S" '((0 . "line,lwpolyline"))))
(princ "\n请选取第2条线:")
(setq ssb (ssget ":S" '((0 . "line,lwpolyline"))))
)
(progn
(setq obja (vlax-ename->vla-object (ssname ssa 0)))
(setq objb (vlax-ename->vla-object (ssname ssb 0)))
(setq jdb (vl-catch-all-apply 'vlax-invoke (list obja "intersectwith" objb acExtendBoth)))
(if (not (vl-catch-all-error-p jdb))
(progn
;;自定义半径
(setq r (getreal"\n输入圆半径: "))
(setq pt (list (car jdb) (cadr jdb)))
(command "_point" pt)
(command "_chprop" (entlast) "" "c" 1 "")
(command "_circle" pt r)
(command "_chprop" (entlast) "" "c" 1 "")
)
(alert "求交点出错!")
)
)
)
(command "_undo" "e")
(setvar "osmode" osm)
(setvar "cmdecho" cmd)
(princ)
) satan421 发表于 2019-12-5 09:02
(defun c:qjd()
(vl-load-com)
(setq cmd (getvar "cmdecho"))
非常感谢帮忙,效果完美
页:
[1]