sds_bbox

sds_bbox

int sds_bbox(const sds_name entname, sds_point lowerleft, sds_point upperright);


Determine the bounding box of an entity.


Given the name of an entity, this function returns the lower left and upper right points of the entity’s bounding box.

The argument entname is the name of the entity whose bounding box is to be determined.

The argument lowerleft returns the lower left point of the entity’s bounding box.

The argument upperright returns the upper right point of the entity’s bounding box.

The function returns RTNORM if successful; otherwise, it returns RTERROR.

Example

sds_point lowerleft, upperright;

sds_name entname;

sds_name_clear(entname);

if (sds_entlast(entname) == RTNORM)

{

if (sds_bbox(entname, lowerleft, upperright) == RTNORM)

{

// Draw a grdraw box around the bounding box

sds_point upperleft, lowerright;

upperleft[0] = lowerleft[0];

upperleft[1] = upperright[1];

upperleft[2] = lowerleft[2];

lowerright[0] = upperright[0];

lowerright[1] = lowerleft[1];

lowerright[2] = upperright[2];

sds_grdraw(lowerleft, upperleft, 1, 0);

sds_grdraw(upperleft, upperright, 1, 0);

sds_grdraw(upperright, lowerright, 1, 0);

sds_grdraw(lowerright, lowerleft, 1, 0);

}

}

Programming Overview of SDS (Solutions Development System)

URL:  http://www.progecad.us/index.pl?iid=21186
Printed on:  June 18, 2013 11:55 PM