 - ;---三个点求夹角,p2为顶点,返回角度
- (defun polyline-deg(p1 p2 p3 / ang)
- (setq ang(-(angle p2 p3)(angle p2 p1)))
- (if(< ang 0)(setq ang(+(* 2.0 pi)ang)))
- (if(> ang pi)(setq ang(-(* 2.0 pi)ang)))
- (/(* ang 180)pi);弧度=(角度*pi)/180
- )
- ;---获取多段线子段线长度表
- (defun get-subc-len(obj / a b lst n)
- (setq lst nil)
- (repeat(fix(setq n(vlax-curve-getEndParam obj)))
- (setq a(vlax-curve-getDistAtParam obj n))
- (setq b(vlax-curve-getDistAtParam obj(setq n(1- n))))
- (setq lst(cons(- a b)lst))
- )
- )
|