为简单点,我没有考虑弧线
(defun get_lw_p(en / enlist points num flag ele)(setq enlist (entget en)
ele (cdr (assoc 38 enlist))
points '()
num (cdr (assoc 90 enlist))
flag (cdr (assoc 70 enlist))
)
(repeat num
(setq xy (cdr (assoc 10 enlist))
xy (list (car xy) (cadr xy) ele)
points (cons xy points)
enlist (cdr (member (assoc 10 enlist) enlist))
)
)
(if (= 1 (logand flag 1))
(progn
(setq xy (car (last points))
xy (list xy arc42)
points (cons xy points)
)
)
)
points
)
;VLISP中好像有这种函数
以内函数可求任意曲线的长度
(defun vla-get-ObjLength (Obj / EndParam ObjLength)(if (= (type Obj) 'ENAME)
(setq Obj (vlax-ename->vla-object Obj))
);end if
(setq EndParam
(vl-catch-all-apply
'vlax-curve-GetEndParam
(list Obj)
)
)
(if (not (vl-catch-all-error-p EndParam))
(setq ObjLength
(vlax-curve-getdistatparam Obj EndParam)
)
);end if
ObjLength
);end vla-get-ObjLength
页:
1
[2]