Functions
Element Creation

Functions

int mdlArc_create (MSElementP out, MSElementP in, DPoint3dP center, double axis1, double axis2, RotMatrixP rMatrix, double start, double sweep)
 
Creates a MicroStation arc element in out from the

parameters passed. More...

 
int mdlArc_createByCenter (MSElementP out, MSElementP in, DPoint3dP pts, int useRad, double rad, int view)
 
Creates a MicroStation arc element

in out defined by its center and two end points. More...

 
int mdlArc_createByPoints (MSElementP out, MSElementP in, DPoint3dP pts)
 Creates a MicroStation arc element defined by three points. More...
 
int mdlArc_createByDEllipse3d (MSElementP elementP, MSElementP templateP, DEllipse3d *ellipseP)
 
Used to create a new arc element,

given an ellipse element. More...

 
int mdlCircle_createBy3Pts (MSElementP out, MSElementP in, DPoint3dP pt, int fillMode)
 
Creates a MicroStation circular ellipse

element in out defined by three points in the perimeter. More...

 
void mdlComplexChain_createHeader (MSElementP chain, int shapeMode, int fillMode)
 Creates a complex chain header element. More...
 
int mdlCone_create (MSElementP out, MSElementCP in, double topRadius, double bottomRadius, DPoint3dCP base, DPoint3dCP top, RotMatrixCP coneRMatrix)
 Creates a MicroStation cone element in out. More...
 
int mdlCone_createRightCylinder (MSElementP out, MSElementP in, double radius, DPoint3dCP base, DPoint3dCP top)
 This function is provided as a convenience. More...
 
int mdlCone_createWithRotMatrix (MSElementP out, MSElementCP in, double topRadius, double bottomRadius, DPoint3dCP base, DPoint3dCP top, RotMatrixCP coneRMatrix)
 
Creates a MicroStation cone element

in out. More...

 
int mdlCurve_create (MSElementP out, MSElementP in, DPoint3dP points, size_t numVerts)
 
Creates a shape element and the mdlCurve_create

function creates a curve element. More...

 
int mdlEllipse_create (MSElementP out, MSElementCP in, DPoint3dCP center, double axis1, double axis2, RotMatrixCP rMatrix, int fillMode)
 
Creates a MicroStation ellipse element in out from the

parameters passed. More...

 
int mdlLineString_create (MSElementP out, MSElementP in, DPoint3dP points, int numVerts)
 Creates a line string element. More...
 
int mdlLine_create (MSElementP pElementOut, MSElementP pElementIn, DPoint3dP points)
 Creates a MicroStation Line element. More...
 
void mdlPointString_create (MSElementP pElementOut, MSElementP pElementIn, DPoint3dP pPoints, double *rMatrices, int numverts, int disjoint)
 Creates a MicroStation point string element. More...
 
int mdlShape_create (MSElementP out, MSElementP in, DPoint3dP points, size_t numVerts, int fillMode)
 Creates a shape element. More...
 
void mdlSurface_createHeader (MSElementP surf, int surfType)
 Creates a complex surface header element. More...
 

Detailed Description

Function Documentation

int mdlArc_create ( MSElementP  out,
MSElementP  in,
DPoint3dP  center,
double  axis1,
double  axis2,
RotMatrixP  rMatrix,
double  start,
double  sweep 
)

Creates a MicroStation arc element in out from the

parameters passed.

All parameters other than start and sweep are transformed by the current transform if one exists.

Parameters
[out]out
[in]inan input template, symbology and level from this element is used if not NULL
[in]centerdefines the center point for the arc. If center is NULL, the center is placed at (0, 0, 0) in the current coordinate system.
[in]axis1size of the primary arc axis
[in]axis2size of the secondary arc axis
[in]rMatrixis the arc's rotation matrix. If rMatrix is NULL, the identity matrix (no rotation) is used.
[in]startthe arc's starting angle in radians
[in]sweepthe arc's sweep angle in radians.
Remarks
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
Returns SUCCESS if a valid MicroStation element is created. It returns MDLERR_BADELEMENT if the resulting arc is beyond the design plane.
See also
mdlArc_createByPoints mdlArc_extract
Remarks
Required Library: mdlbltin.lib
int mdlArc_createByCenter ( MSElementP  out,
MSElementP  in,
DPoint3dP  pts,
int  useRad,
double  rad,
int  view 
)

Creates a MicroStation arc element

in out defined by its center and two end points.

The points are transformed by the current transform if one exists. arcPts[0] is the starting point, arcPts[1] is the center point, and arcPts[2] is the ending point.

Parameters
[out]outarc created
[in]intemplate element
[in]ptscenter and end points
[in]useRad1=use radius, 0=use points
[in]radradius (if useRadius is true)
[in]viewview number
Remarks
If useRad is true, the radius is specified by radius, and arcPts[0] and arcPts[2] determine only the arc's start and sweep. Otherwise, the radius is determined by the distance between the center and the first point. If all three arcPts are colinear in a 3D file, the rotation matrix of view determines the arc's plane.
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
Returns SUCCESS if a valid MicroStation element is created. Returns MDLERR_BADELEMENT if the resulting arc is beyond the design plane or if the three points are colinear.
See also
mdlArc_create mdlArc_extract mdlArc_createByPoints
Remarks
Required Library: mdlbltin.lib
int mdlArc_createByDEllipse3d ( MSElementP  elementP,
MSElementP  templateP,
DEllipse3d ellipseP 
)

Used to create a new arc element,

given an ellipse element.

The rotation matrix, radius, start and sweep values of the new arc are all obtained from the ellipse element.

Parameters
[out]elementPis a pointer to the arc element created by this function.
[in]templatePis a template element from which certain attributes values are copied to the arc element.
[in]ellipsePis a pointer to the ellipse element from which the rotation matrix, radius, start, and sweep values are taken to create the arc element.
Returns
SUCCESS if the operation is completed successfully, MDLERR_BADELEMENT if an error occurs.
See also
mdlArc_create
Remarks
Required Library: mdlbltin.lib
int mdlArc_createByPoints ( MSElementP  out,
MSElementP  in,
DPoint3dP  pts 
)

Creates a MicroStation arc element defined by three points.

The points are transformed by the current transform if one exists. arcPts[0] is the starting point, arcPts[2] is the ending point, and arcPts[1] is another point on the arc.

Parameters
[out]outarc created
[in]intemplate element
[in]ptspoints on arc
Remarks
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
Return SUCCESS if a valid MicroStation element is created. Returns MDLERR_BADELEMENT if the resulting arc is beyond the design plane or if the three points are colinear.
See also
mdlArc_create mdlArc_extract mdlArc_createByCenter
Remarks
Required Library: mdlbltin.lib
int mdlCircle_createBy3Pts ( MSElementP  out,
MSElementP  in,
DPoint3dP  pt,
int  fillMode 
)

Creates a MicroStation circular ellipse

element in out defined by three points in the perimeter.

The points in the point parameter are transformed by the current transform if one exists.

Parameters
[out]outcircle created
[in]intemplate element
[in]ptperimeter points
[in]fillModedetermines whether the created circle is filled. See mdlShape_create for possible values of fillMode.
Remarks
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
Returns SUCCESS if a valid MicroStation element is created or MDLERR_BADELEMENT if the resulting ellipse is beyond the design plane.
See also
mdlEllipse_create mdlArc_extract
Remarks
Required Library: mdlbltin.lib
void mdlComplexChain_createHeader ( MSElementP  chain,
int  shapeMode,
int  fillMode 
)

Creates a complex chain header element.

Complex chain header elements are non-displayable elements used to group other displayable elements. For this reason, this function does not have an input element as an argument. Complex chain header elements cannot be added to the design file on their own. Instead, they are used with the element descriptor routines.

Parameters
[out]chainindicates the type of chain mdlComplexChain_createHeader is to create. If chain is true, it creates a complex shape header. Otherwise, it creates a complex chain header.
[in]shapeModetrue if this is going to be a shape
[in]fillModeIf chain is true, fillMode for the mdlComplexChain_createHeader function determines whether the shape is filled or open. Possible values are as follows: fillMode: Meaning -1: Use the active fillMode from MicroStation. 0: The shape is not filled. 1: The shape is filled.
int mdlCone_create ( MSElementP  out,
MSElementCP  in,
double  topRadius,
double  bottomRadius,
DPoint3dCP  base,
DPoint3dCP  top,
RotMatrixCP  coneRMatrix 
)

Creates a MicroStation cone element in out.

The cone is defined by two circles specified by their radii, topRadius, and bottomRadius and their center points, base and top. If base or top is NULL, the coordinate (0, 0, 0) in the current coordinate system is used.

Parameters
[out]outelement to be created
[in]inoptional starting element
[in]topRadiustop radius
[in]bottomRadiusbottom radius
[in]basecenter of base
[in]topcenter of top
[in]coneRMatrixspecifies a skew rotation to be applied to the top and bottom circles. If coneRMatrix is NULL, a right cone is created.
Returns
Returns SUCCESS if a valid MicroStation element is created. If the design file is 2D, mdlCone_create returns MDLERR_FILE2SUB3. It returns MDLERR_BADELEMENT if the resulting cone is beyond the design plane.
See also
mdlCone_createWithRotMatrix mdlCone_createRightCylinder mdlCone_extract
int mdlCone_createRightCylinder ( MSElementP  out,
MSElementP  in,
double  radius,
DPoint3dCP  base,
DPoint3dCP  top 
)

This function is provided as a convenience.

It produces the same result as calling mdlCone_create with topRadius and bottomRadius equal and coneRMatrix set to NULL: mdlCone_create(out, in, radius, radius, base, top, NULL);

Parameters
[out]outelement to be created
[in]inoptional starting element
[in]radiusradius (both top and bottom)
[in]basecenter of base
[in]topcenter of top
Returns
Returns SUCCESS if a valid MicroStation element is created. If the design file is 2D, it returns MDLERR_FILE2SUB3. It returns MDLERR_BADELEMENT if the resulting cone is beyond the design plane.
See also
mdlCone_create mdlCone_extract
int mdlCone_createWithRotMatrix ( MSElementP  out,
MSElementCP  in,
double  topRadius,
double  bottomRadius,
DPoint3dCP  base,
DPoint3dCP  top,
RotMatrixCP  coneRMatrix 
)

Creates a MicroStation cone element

in out.

The cone is defined by two circles specified by their radii topRadius and bottomRadius and their center points, base and top. The orientation of both circles is specified by coneRMatrix. This rotation matrix specifies the circle orientation directly and is not a skew matrix as used in mdlCone_create; it is the same rotation matrix that is returned by mdlCone_extract.

Parameters
[out]outelement to be created
[in]inoptional starting element
[in]topRadiustop radius
[in]bottomRadiusbottom radius
[in]basecenter of base
[in]topcenter of top
[in]coneRMatrixgeneral cone Transformation
Returns
Returns SUCCESS if a valid MicroStation element is created. If the design file is 2D, it returns MDLERR_FILE2SUB3. It returns MDLERR_BADELEMENT if the resulting cone is beyond the design plane.
See also
mdlCone_create mdlCone_extract
int mdlCurve_create ( MSElementP  out,
MSElementP  in,
DPoint3dP  points,
size_t  numVerts 
)

Creates a shape element and the mdlCurve_create

function creates a curve element.

Parameters
[out]outcurve created
[in]intemplate element
[in]pointsvertices
[in]numVertsindicates the number of vertices in points and must be 2 <= numVerts <=MAX_VERTICES (5000). The points are transformed by the current transform if one exists.
Remarks
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
SUCCESS if a valid MicroStation element is created, MDLERR_BADELEMENT if the coordinates are beyond the design plane.
See also
mdlLineString_create mdlLinear_extract mdlShape_create
int mdlEllipse_create ( MSElementP  out,
MSElementCP  in,
DPoint3dCP  center,
double  axis1,
double  axis2,
RotMatrixCP  rMatrix,
int  fillMode 
)

Creates a MicroStation ellipse element in out from the

parameters passed.

All parameters are transformed by the current transform if one exists.

Parameters
[out]outellipse created
[in]intemplate element
[in]centerdefines the ellipse's center point. If center is NULL, the center is placed at (0, 0, 0) in the current coordinate system.
[in]axis1the primary axis (the axis at 0&#176; in the arc/ellipse coordinate system) is passed in axis1
[in]axis2the secondary axis (the axis at 90&#176; ) is passed in axis2.
Remarks
You can produce a circle by setting axis1 equal to axis2.
Parameters
[in]rMatrixis the arc's rotation matrix. If rMatrix is NULL, the identity matrix (no rotation) is used.
[in]fillModedetermines whether the created ellipse is filled. See mdlShape_create for possible values of fillMode.
Remarks
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
SUCCESS if a valid MicroStation element is created. MDLERR_BADELEMENT if the resulting ellipse is beyond the design plane.
See also
mdlCircle_createBy3Pts mdlArc_extract
int mdlLine_create ( MSElementP  pElementOut,
MSElementP  pElementIn,
DPoint3dP  points 
)

Creates a MicroStation Line element.

Parameters
[out]pElementOutline element created
[in]pElementIntemplate element
[in]pointsend points
Returns
SUCCESS if a valid MicroStation element is created. MDLERR_BADELEMENT if the coordinates are beyond the design plane.
See also
mdlLineString_create mdlShape_create mdlCurve_create mdlLinear_extract mdlCurve_createI
int mdlLineString_create ( MSElementP  out,
MSElementP  in,
DPoint3dP  points,
int  numVerts 
)

Creates a line string element.

Parameters
[out]outline string created
[in]intemplate element
[in]pointsvertices
[in]numVertsindicates the number of vertices in points and must be
2 <= numVerts <= MAX_VERTICES (5000). The points are transformed by the current transform if one exists.
Remarks
If in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
SUCCESS if a valid MicroStation element is created. MDLERR_BADELEMENT if the coordinates are beyond the design plane.
See also
mdlShape_create mdlCurve_create mdlLinear_extract
void mdlPointString_create ( MSElementP  pElementOut,
MSElementP  pElementIn,
DPoint3dP  pPoints,
double *  rMatrices,
int  numverts,
int  disjoint 
)

Creates a MicroStation point string element.

A point string element consists of vertices with orientations at each vertex.

Parameters
[out]pElementOutpoint string element
[in]pElementIntemplate element
[in]pPointsspecifies the point string's vertices.
[in]rMatricesis an array of rotation matrices, one matrix for each vertex. In 2D, the rotation matrices are 2×2 matrices, and in 3D they are 3×3 matrices.
[in]numvertsis the number of vertices in the point string. points and rMatrices should be dimensioned to numVerts. The maximum number of vertices for a point string is 48.
[in]disjointdetermines whether out is created as a disjoint or continuous point string. Continuous point strings display with lines connecting the vertices.
int mdlShape_create ( MSElementP  out,
MSElementP  in,
DPoint3dP  points,
size_t  numVerts,
int  fillMode 
)

Creates a shape element.

Parameters
[out]outshape created
[in]pointsvertices
[in]numVertsindicates the number of vertices in points and must be 3 <= numVerts <=MAX_VERTICES (5000). The points are transformed by the current transform if one exists. If the last point supplied is not equivalent to the first point, then an additional point is automatically inserted to ensure closure.
[in]fillModefor the mdlShape_create function determines whether the shape is filled or open. Possible values are as follows:. fillMode: Meaning -1: Use the active fillMode from MicroStation. 0: The shape is not filled. 1: The shape is filled.
[in]inIf in is NULL, the display parameters for the created element are taken from the active MicroStation settings when the function is called. Otherwise, the display parameters from in are used. All attribute information from in is retained in out.
Returns
SUCCESS if a valid MicroStation element is created. MDLERR_BADELEMENT if the coordinates are beyond the design plane.
See also
mdlLineString_create mdlLinear_extract
void mdlSurface_createHeader ( MSElementP  surf,
int  surfType 
)

Creates a complex surface header element.

Complex surface elements are non-displayable elements that group other displayable elements. For this reason, this function does not have an input element as an argument. Complex surface header elements cannot be automatically added to the design file. Instead, they should be used with the Element Descriptor routines.

Parameters
[out]surfnew surface header
[in]surfTypeindicates the type of surface to be created by mdlSurface_createHeader. Possible values are: 0 = surface of projection, 8 = surface of revolution.
Remarks
MDL applications do not generally need mdlSurface_createHeader, since the mdlSurface_project and mdlSurface_revolve functions automatically create surface headers. Only advanced applications need this function to create special types of surfaces.
See also
mdlSurface_project mdlSurface_revolve mdlParams_setActive

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.