vlax-curve-getDistAtParam

AutoCad AutoLISP Functions

 
vlax-curve-getDistAtParam
 
 
 

Returns the length of the curve's segment from the curve's beginning to the specified parameter

(vlax-curve-getDistAtParam curve-objparam) 

Arguments

curve-obj

The VLA-object to be measured.

param

A number specifying a parameter on the curve.

Return Values

A real number that is the length up to the specified parameter, if successful; otherwise nil.

Examples

Assume that splineObj points to the spline in the following drawing:

Sample curve (spline) for vlax-curve-getDistAtParam

Obtain the start parameter of the curve:

_$ (setq startSpline (vlax-curve-getStartParam
splineObj))
0.0

The curve starts at parameter 0.

Obtain the end parameter of the curve:

_$ (setq endSpline (vlax-curve-getEndParam
splineObj))
17.1546

The curve's end parameter is 17.1546.

Determine the distance to the parameter midway along the curve:

_$ (vlax-curve-getDistAtParam
splineObj 
         ( / (- endspline startspline)
2))
    
8.99417

The distance from the start to the middle of the curve is 8.99417.