MKI_CalcEquidistantEx (Calculation) Changed in Version 2023.2

www.CAD6.com

C++ Syntax

MKI_RESULTVALUE

MKI_CalcEquidistantEx(

 MKI_CONST_ENTITY_OBJECT_PTR f_pObjPtr1,

 MKI_ENTITY_OBJECT_PTR f_pObjPtr2,

 double f_dDistance,

 bool f_fRounded,

 bool f_fResolve,

 MKI_CONST_SIMPLIFY_DATA_PTR f_pSimplify,

 MKI_CONST_POINT_PTR f_pReferencePoint,

 bool& f_pfInside );

 

Calculates the equidistant to a given object. The result is also a valid object.

 

Not supported in CAD6starter!

 

Parameters

f_pObjPtr1

[MKI_CONST_ENTITY_OBJECT_PTR] Address of the object to which the equidistant shall be calculated. This object must be of one of the following types (see MKI_OBJ_*):

 

MKI_OBJ_LINE

MKI_OBJ_ZIGZAG

MKI_OBJ_CURVE

MKI_OBJ_SURFACE

MKI_OBJ_SPLINE

MKI_OBJ_CIRCLE

MKI_OBJ_ARC

MKI_OBJ_SECTOR

MKI_OBJ_SEGMENT

MKI_OBJ_ELLIPSE

MKI_OBJ_EARC

MKI_OBJ_ESECTOR

MKI_OBJ_ESEGMENT

If a curve or surface contains more than one outline, only the outline lying closest to f_rReferencePoint will be used.

f_pObjPtr2

[MKI_ENTITY_OBJECT_PTR] Address of a buffer that shall receive the calculated equidistant object. This buffer must be at least MKI_MaxEntityData() bytes large, and can e.g. be created using MKI_EntityBuffer(). The resulting object will be of one of the following types (see MKI_OBJ_*):

 

MKI_OBJ_LINE

MKI_OBJ_CURVE

MKI_OBJ_SURFACE

MKI_OBJ_ZIGZAG

MKI_OBJ_CIRCLE

MKI_OBJ_ARC

f_dDistance

[double] The distance that the equidistant shall have to the original object, in internal [mm]. This value may be negative, this will have no other effect than the same positive value.

f_fRounded

[bool] This value determines whether the edges of the calculated equidistant shall be rounded or not. If true, the edges will be rounded.

f_fResolve

[bool] If true, all complex objects (curves, hatches, surface) will be resolved into polylines before calculating the equidistant. This will lead to more reliable, but less accurate results.

f_pSimplify Changed in Version 6.51

[MKI_CONST_SIMPLIFY_DATA_PTR] Address of a set of options for the simplification or nullptr if the application's current settings shall be used. Use MKI_DialogTrimSimplify to allow the user to view and edit these settings.

f_pReferencePoint

[MKI_CONST_POINT_PTR] If not nullptr, this reference point determines on which side of the object the equidistant will be placed. It will be placed on the same side as the reference point lies relative to the object. The resulting information ("inside" or "outside") will be written to f_fInside to be used in subsequent calls without a reference point.

 

If the original object is a surface and consists of multiple outlines, this reference point also determines the outline to which the equidistant shall be calculated. The equidistant will be calculated to the outline that lies closest to the reference point. In subsequent calls with f_pReferencePoint set to nullptr, the first outline will always be used.

f_pInside

[bool&] Address of a boolean value stating the direction of the equidistant calculation. If f_pReferencePoint is not nullptr, this value will be initialized according to the reference point's relative position. If f_pReferencePoint is nullptr, this value will be used as input.

 

Return Value Changed in Version 2022.1

Result as a bitwise-or combination of flags (see MKI_RESULT_*).

 

MKI_RESULT_OK

The equidistant was calculated successfully.

 

MKI_RESULT_INACCURATE

The equidistant was calculated mostly successfully, but some sections were only roughly interpolated. If f_fRounded was not active, trying again with f_fRounded set may lead to better results.

 

MKI_RESULT_IMPOSSIBLE

No equidistant possible based on the given distance.

 

MKI_RESULT_COMPLEX

The given original object is too complex to calculate the result (e.g. due to too many lines after resolving if f_fResolve is set).

 

MKI_RESULT_MEMORYFULL

The command cannot be executed due to full memory.

 

MKI_RESULT_PARAMETER

Parameters were invalid.

 

Comment

All non-geometric data stored in f_pObjPtr1 will be copied to f_pObjPtr2, especially all properties.

 

In order to insert the resulting equidistant into the drawing, use the MKI_ObjectOpen, MKI_ObjectCopyDataBlocks, and the MKI_ObjectFastInsert functions.

 

CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH