What means "double& param" in AcDbPolyline::onSegAt(..)

What means "double& param" in AcDbPolyline::onSegAt(..)

majklha
Advocate Advocate
698 Views
1 Reply
Message 1 of 2

What means "double& param" in AcDbPolyline::onSegAt(..)

majklha
Advocate
Advocate

AcDbPolyline has method onSegAt().  What menas double& (out) parameter param in the method? 

Thanks.

0 Likes
Accepted solutions (1)
699 Views
1 Reply
Reply (1)
Message 2 of 2

tbrammer
Advisor
Advisor
Accepted solution

All curves in AutoCAD are implemented as parameterized functions. They have a start parameter ps that defines the starting point and an end parameter pe that defines the endpoint. The curve is defined on the interval [ps,pe]

The baseclass of DB resident curves is AcDbCurve. AcDbPolyline is derived from AcDbCurve. These methods retrieve start- and end parameter and calculate a point on a curve for a given parameter:

Acad::ErrorStatus AcDbCurve::getStartParam(double &ps) const;
Acad::ErrorStatus AcDbCurve::getEndParam(double &pe) const;
Acad::ErrorStatus AcDbCurve::getPointAtParam(double param, AcGePoint3d &pt) const;

 

Vertex points of an AcDbPolyline  have integer parameter values (0.0, 1.0, 2.0...). The parameter of a point is not the same as the curve length from the startpoint to the point. The ARX API has several functions to "convert" between point, parameter and path length.

 

Non DB resident curves work in a similiar way:

void AcGeCurve2d::getInterval(AcGeInterval& intrvl) const;
AcGePoint2d AcGeCurve2d::evalPoint(double param) const;

void AcGePoint3d::getInterval(AcGeInterval& intrvl) const;
AcGePoint3d AcGeCurve3d::evalPoint(double param) const;

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.