- ;;164.12 [功能] 多段线子段数量
- ;;相当于组码90
- ;;示例 (HH:GetCurveNum (car (entsel)))
- (defun HH:GetCurveNum (obj)
- (if (vlax-curve-isClosed obj)
- (fix (1- (vlax-curve-getendParam obj)))
- (fix (vlax-curve-getendParam obj))
- )
- )
- ;;164.13 [功能] 曲线中点
- ;;示例 (HH:GetMidpointCurve (car (entsel)))
- (defun HH:GetMidpointCurve (curve / d)
- (setq d (/ (vlax-curve-getDistAtParam curve (vlax-curve-getEndParam curve)) 2))
- (vlax-curve-getPointAtDist curve d)
- )
- ;;164.14 [功能] 曲线一点的参数param
- ;;(HH:PtToParam (car (entsel)) (getpoint))
- (defun HH:PtToParam (obj pt)
- (vlax-curve-getParamAtPoint obj pt)
- )
- ;;164.15 [功能] 参数param处的坐标
- ;;(HH:ParamTopt (car (entsel)) 0)
- (defun HH:ParamTopt (obj param)
- (vlax-curve-getPointAtParam obj param)
- )
- ;;164.16 [功能] 多段线第n子段的起点坐标
- ;;示例 (HH:GetSegStratPt (car (entsel)) 0)
- (defun HH:GetSegStratPt (curve n)
- (vlax-curve-getPointAtParam curve (fix n))
- )
- ;;164.17 [功能] 多段线第n子段的终点坐标
- ;;示例 (HH:GetSegEndPt (car (entsel)) 0)
- (defun HH:GetSegEndPt (curve n)
- (vlax-curve-getPointAtParam curve (1+ (fix n)))
- )
By 自贡黄明儒
非本人 |