SE_shape_replace_path_with_arc

Replaces a line or path with a circular arc represented as a series of vectors

Usage syntax

LONG SE_shape_replace_path_with_arc (SE_SHAPE shape, SE_SDEPOINT *firstpt, SE_SDEPOINT *midpt, SE_SDEPOINT *lastpt, LFLOAT radius, LONG arc_segs);

Parameters
shape A handle to an active shape object to change
firstpt Address of an SDEPOINT structure containing the coordinate values of the line’s starting point
midpt Address of an SDEPOINT structure containing the coordinate values of any point along the path between firstpt and lastpt; set this value to NULL if specifying a 2-point line.
lastpt Address of an SDEPOINT structure containing the coordinate values of the last point in the line
radius The radius of the arc from the center to the first and last points on the path
arc_segs The number of segments in a full circle; may be positive or negative to designate a clockwise or counterclockwise arc
Description

SE_shape_replace_path_with_arc replaces one or more line segments of a shape with a circular arc whose radius you specify. The arc begins at the firstpt of the line or path to be replaced and ends at the lastpt. The arc_segs parameter specifies the number of line segments in a full circle. An arc_segs value of 360 makes lines a ‘degree’ long.

The center of the circle made by the radius can be on either side of the line you’re replacing (see below). The two sides of the line are called left and right, determined by the direction of the line. For a line defined as (firstpt, lastpt), right and left are defined from firstpt looking toward lastpt.

If the radius value is positive, the center point of the circle is to the left of a line drawn from the firstpt to the lastpt (circle A); if negative, the center point is to the right of the line (circle B). The absolute value of the radius must be more than one-half the distance between firstpt and lastpt.

Once you’ve chosen a radius, you still have two arcs to choose from. Imagine a line originating at the center of the circle and sweeping from firstpt to the lastpt. There are actually two arcs. One travels clockwise from firstpt to lastpt, while the other travels counterclockwise. A positive arc_segs value rotates counterclockwise from the firstpt. A negative arc_segs value travels clockwise from the firstpt.

The z- and m-values of the SDEPOINT structures are ignored unless the input shape has a z-array and/or a measures array.

Returns

SE_SUCCESS
SE_CAD_EXISTS

SE_COORD_OUT_OF_BOUNDS

SE_INVALID_RADIUS

SE_FAILURE

SE_INVALID_ENTITY_TYPE

SE_INVALID_POINTER

SE_INVALID_SHAPE_OBJECT

SE_OUT_OF_CLMEM

SE_PATH_NOT_FOUND

SE_READ_ONLY_SHAPE

SE_SHAPE_INTEGRITY_ERROR

Notes

∙  If this function does not return successfully, the source shape is unchanged.

∙  If you pass a shape returned from SE_stable_search or SE_stable_get_shape to tgt_shape, the SE_READ_ONLY_SHAPE error is returned.

∙  If the source shape has a CAD entity, the SE_CAD_EXISTS error is returned.