请教一下,如何判断点中了多段线中的圆弧或直边
(defun c:tt(/ ss)
(if (setq ss (getpoint "\n 请点选对象: "))
(progn
;这里如何判断是圆弧或直边,如果是直边就线性标注,如果是圆弧就半径标注
(vl-cmdf "dimradius" "non" (nentselp ss))
(vl-cmdf "dimlinear" "non" (pl_pt ss 1) "non" (pl_pt ss 2) "\\")
)
)
(princ))
(defun pl_pt(ss pt / ne e n)
(setq en (nentselp ss) e (car en))
(setq e (car en))
(setq n (fix (vlax-curve-getparamatpoint e (vlax-curve-getclosestpointto e (cadr en)))))
(nth (- pt 1) (list (vlax-curve-getpointatparam e n) (vlax-curve-getpointatparam e (1+ n))) )
)
(defun c:tt (/ e p)
(if (and (setq e (entsel))
(setq p (cadr e))
(setq e (car e))
(equal'(0.0 0.0 0.0)
(vlax-curve-getSecondDeriv e
(fix (vlax-curve-getparamatpoint e (vlax-curve-getclosestpointto e (trans p 1 0)))
)
)
)
)
"LINE"
"ARC"
)
) 本帖最后由 asen 于 2023-11-26 17:10 编辑
判断向量 AC,CB 两条线的角度, 看是否相等, 相等即为直线, 否则为圆弧.
获取一下param那段的凸度,我用c#是获取param的SegmentType Dani1988 发表于 2023-11-26 16:57
获取一下param那段的凸度,我用c#是获取param的SegmentType
谢谢回复,太深奥了,还搞不懂这些 asen 发表于 2023-11-26 16:54
判断向量 AC,CB 两条线的角度, 看是否相等, 相等即为直线, 否则为圆弧.
请教一下,如何获得c点,如果获得c点,(= (distance a c) (distance b c)) 是不是也可以? C 点是您点中的点 bonny 发表于 2023-11-26 16:07
有点小问题,会把样条曲线也判断为圆弧 669423907 发表于 2023-11-26 20:37
有点小问题,会把样条曲线也判断为圆弧
你看你标题写着啥,多段线 bonny 发表于 2023-11-26 20:44
你看你标题写着啥,多段线
也是,考虑不周:D-
页:
[1]