Modules | Classes | Typedefs | Functions
Type Specific Element Functions

Modules

 2D Constraint Modeling
 Interface to 2D constraint system.
 
 3D Constraint Modeling
 
 Bit Mask
 A BitMask holds a variable-sized array of bits.
 
 Boolean Functions
 
 Cell Functions
 
 Detailing Symbols
 A detailing symbol is an annotation that plays a vital role in drawing composition.
 
 Dimension Elements
 
 Filter Api
 
 Geometry Collectors
 
 Geometric Queries
 
 Line Style Manager
 The Line Style Manager is the root for all line style access.
 
 MatrixElements
 
 MeshElements
 
 Multi-Line Functions
 
 Multi-Line Styles
 
 Named Boundary
 A Named Boundary is a named graphical element that represents a boundary of interest in the model.
 
 Parametric Modeling
 Provides facilities for using variables and variations to define parametric geometry.
 
 Patterning
 
 Reference File
 
 Section Clip
 SectionClip holds information associated with the clip volume tool which inturn is used to limit the displayed volume for a view to the region within a clipping element.
 
 Solids Api
 
 Surface Creation
 
 Surface Functions
 
 TagFunctions
 
 Tables
 
 Text
 The text module refers to element-based text, including the classes and interfaces that can be used to work both with text elements, and other element types that expose text.
 

Classes

struct  fillSymbology
 The element filll symbology. More...
 

Typedefs

typedef struct fillSymbology FillSymbology
 The element filll symbology. More...
 

Functions

int mdlArc_extractDEllipse3d (DEllipse3d *pEllipse, MSElementP pEllipseElement)
 
Used to extract ellipse data from an ellipse

or arc element. More...

 
UInt32 mdlElement_add (MSElementP element)
 Adds a new MicroStation element to the design file. More...
 
UInt32 mdlElement_append (MSElementP element)
 
Adds the modified MicroStation element

pointed to by element to the design file. More...

 
int mdlElement_appendAttributes (MSElementP pElement, int length, void const *buffer)
 Appends attribute information in the attributes buffer to the end of any existing attributes on the element pointed to by element. More...
 
void mdlElement_display (MSElementP elementP, DgnPlatform::DgnDrawMode drawmode)
 Displays the MicroStation element pointed to by element in all active views. More...
 
void mdlElement_displayInSelectedViews (MSElementP pElement, int drawmode, int viewMask)
 
This function is identical to

mdlElement_display except that is has an additional parameter, viewMask, that specifies the views into which the element will be drawn. More...

 
int mdlElement_extractAttributes (int *length, UInt16 *buffer, MSElementCP pElement)
 
Extracts attribute information from

the element pointed to by element. More...

 
int mdlElement_setFilePos (int type, DgnModelRefP modelRef, UInt32 position)
 Sets the file position for various elements. More...
 
UInt32 mdlElement_getFilePos (int type, DgnModelRefP *pModelRef)
 Returns the file position for various elements. More...
 
int mdlElement_extractRange (DRange3d *rangeP, MSElementCP pElement)
 Used to extract the range from an element. More...
 
UInt32 mdlElement_getHeaderFilePos (UInt32 filePos, DgnModelRefP modelRef)
 Finds the file position for the outermost complex header for the element at the file position specified in the given model. More...
 
int mdlElement_getType (MSElementCP el)
 
Returns the type of the element pointed

to by element. More...

 
void mdlElement_getProperties (UInt32 *level, UInt32 *ggNum, DgnPlatform::DgnElementClass *elmClass, bool *locked, bool *newElm, bool *modified, bool *viewIndepend, bool *solidHole, MSElementCP pElement)
 
Extracts the level, graphic group number,

class, locked status, new status, modified status, view independence status, and solid-hole status from the element pointed to by element. More...

 
bool mdlElement_isEffectivelyLocked (DgnModelRefP modelRefIn, MSElementCP pElement)
 
Used to determine whether

the specified element is effectively locked. More...

 
bool mdlElementRef_isEffectivelyLocked (DgnModelRefP modelRef, ElementRefP elemRef, bool checkChildren)
 Determine whether an ElementRefP is effectively locked. More...
 
bool mdlElementRef_isLocked (DgnModelRefP modelRef, ElementRefP elemRef, bool checkChildren)
 Determine whether an ElementRefP or (optionally) any of it's children, has it's lock bit set. More...
 
bool mdlElementRef_checkLevelLock (ElementRefP elemRef, DgnModelRefP modelRef)
 Determine whether an ElementRefP is on a level that is not the active level while the Level Lock is active. More...
 
int mdlElement_getLock (bool *pLockFlagOut, bool *pEffectiveLockFlagOut, DgnModelRefP modelRefIn, MSElementCP pElementIn)
 Used to get the lock values of the specified element. More...
 
void mdlElement_getSymbology (UInt32 *color, UInt32 *weight, Int32 *style, MSElementCP el)
 Extracts the color, weight and style from the element pointed to by element. More...
 
void mdlElement_getEffectiveSymbology (UInt32 *pColorOut, UInt32 *pWeightOut, Int32 *pStyleOut, LineStyleParamsP pStyleParamOut, UInt32 *pFillColorOut, MSElementCP pElementIn, const DgnModelRefP pModelRefIn, void *pElementPathIn, int viewIndexIn)
 Extracts the effective color, weight, style and fill color from the element. More...
 
bool mdlElement_isVisible (MSElementCP pElementIn)
 Check if an element is visible. More...
 
bool mdlElement_isEffectivelyVisible (MSElementCP pElementIn, const DgnModelRefP pModelRefIn, int viewIndexIn)
 Check if an element is effectively visible - considers if the level that the element is ON is also visible. More...
 
bool mdlElement_isFilled (MSElementCP el)
 Returns element fill status. More...
 
bool mdlElement_extractFillSymbology (FillSymbology *pFillSymbology, MSElementP u)
 Returns element fill status and fill symbology. More...
 
double mdlElement_getTransparency (MSElementCP pElement)
 Query display transparency linkage on an element. More...
 
StatusInt mdlElement_setTransparency (MSElementP pElement, double transparency)
 Add display transparency linkage to an element. More...
 
StatusInt mdlElmdscr_setTransparency (MSElementDescrH edPP, double transparency)
 Add display transparency an element descriptor. More...
 
Int32 mdlElement_getDisplayStyle (MSElementCP pElement)
 Query display style linkage on an element. More...
 
StatusInt mdlElement_setDisplayStyle (MSElementP pElement, Int32 styleIndex)
 Add display style linkage to an element. More...
 
StatusInt mdlElmdscr_setDisplayPriority (MSElementDescrH edPP, Int32 priority)
 Set display priority of an element descriptor. More...
 
int mdlElement_read (MSElementP pElement, DgnModelRefP modelRef, UInt32 filepos)
 
Reads an element from a design file to the memory

pointed to by element. More...

 
UInt32 mdlElement_rewrite (MSElementP newElem, MSElementP oldElem, UInt32 filePos)
 
Overwrites an existing MicroStation element with a new element

pointed to by newElem at file position filePos. More...

 
void mdlElement_setProperties (MSElementP el, UInt32 const *level, UInt32 const *ggNum, DgnPlatform::DgnElementClass const *elementClass, bool const *locked, bool const *newElm, bool const *modified, bool const *viewIndepend, bool const *solidHole)
 
Changes the level, graphic group number, class, locked status, new status,

modified status, view independence status, and solid-hole status in the element pointed to by element. More...

 
void mdlElement_setSymbology (MSElementP el, UInt32 const *color, UInt32 const *weight, Int32 const *style)
 
Changes the color, weight, and

style in the element pointed to by element to the values pointed to by color, weight and style. More...

 
StatusInt mdlElement_setFillColor (MSElementP elementP, UInt32 fillColor)
 Sets an element's interior fill color, while mdlElement_getFillColor queries the existing fill color of an element. More...
 
StatusInt mdlElement_getFillColor (UInt32 *fillColorP, MSElementCP elementP)
 
Gets an element's interior fill color, while

mdlElement_setFillColor sets the existing fill color of an element. More...

 
void mdlElement_stripAttributes (MSElementP out, MSElementP in)
 
Strips attribute information from the

input element in and puts the result in out. More...

 
int mdlElement_stroke (DPoint3dP *points, int *nPoints, MSElementP el, double tol)
 
Strokes the element pointed to by <code>el</code> into

vectors in an array pointed to by points. More...

 
StatusInt mdlElement_undoableDelete (MSElementP pElement, UInt32 filePos, bool display)
 
Deletes the element pointed to by

element at file position filePos. More...

 
int mdlElement_transform (MSElementP out, MSElementP in, TransformP transform, bool allowSizeChange=false)
 Transforms an element by the supplied transformation matrix and places the result in out. More...
 
int mdlElement_offset (MSElementP out, MSElementP in, DPoint3dP offset, bool allowSizeChange=false)
 Moves the element in by the distance given by offset and places the result in out. More...
 
int mdlElement_setLineStyle (MSElementP pElement, DgnModelRefP modelRef, int lsIndex, WCharCP styleNameP, LineStyleParamsP paramsP)
 Sets the line style of the element pointed to by elementP to the new MicroStation line style defined by pStyleName and pParams. More...
 
int mdlElement_getLineStyle (WCharP styleNameP, LineStyleParamsP paramsP, MSElementCP elementP, DgnModelRefP modelRef, int lsIndex)
 Retrieves the line style information from an element. More...
 
int mdlElement_getEffectiveLineStyle (WCharP pName, int numChars, LineStyleParamsP pParamsOut, MSElementCP pElementIn, DgnModelRefP modelRef, void *pElementPathIn, int lsIndexIn)
 
The effective line style of an element is the fully resolved line style; in

other words, the style with which it will be drawn. More...

 
bool mdlElement_hasLineStyle (MSElementCP elementP)
 
Used to test the specified element to

see whether a line style other than one of the standard eight styles (style 0 through 7) has been applied to it. More...

 
void mdlElmdscr_getProperties (DgnPlatform::LevelId *level, UInt32 *ggNum, DgnPlatform::DgnElementClass *dgnClass, bool *locked, bool *newElm, bool *modified, bool *viewIndepend, bool *solidHole, MSElementDescrCP edP)
 Queries the level, element class, graphic group, and other properties of the element desciptor pointed to by edP. More...
 

Detailed Description

Typedef Documentation

typedef struct fillSymbology FillSymbology

The element filll symbology.

Function Documentation

int mdlArc_extractDEllipse3d ( DEllipse3d pEllipse,
MSElementP  pEllipseElement 
)

Used to extract ellipse data from an ellipse

or arc element.

Parameters
[out]pEllipseis the ellipse data extracted from the ellipse element, or arc element.
[in]pEllipseElementis an ellipse element, or an arc element, from which the ellipse information will be extracted.
Returns
SUCCESS if the operation is completed successfully, ERROR if an error occurs.
See also
mdlArc_extract
Remarks
Required Library: mdlbltin.lib
UInt32 mdlElement_add ( MSElementP  element)

Adds a new MicroStation element to the design file.

Before writing the element to the file, mdlElement_add sets the properties bits in the element header to not locked, new element and not modified.

Parameters
[in]elementelement to add
Remarks
MicroStation remembers the mdlElement_add and mdlElement_append functions, so the user can undo them.
Returns
The file position of the element added to the design file. If an error occurs, the function returns zero and the global variable mdlErrno is set to the specific error cause. Possible values for mdlErrno are MDLERR_READONLY, MDLERR_DISKFULL, MDLERR_WRITEINHIBIT, MDLERR_BADELEMENT and MDLERR_WRITEFAILED.
See also
mdlElement_rewrite mdlElement_append
Remarks
Required Library: mdlbltin.lib
UInt32 mdlElement_append ( MSElementP  element)

Adds the modified MicroStation element

pointed to by element to the design file.

The mdlElement_append function is needed when an application modifies an element and changes its size. mdlElement_rewrite can also be used for this purpose, but this function requires that you know the old file position.

Parameters
[in]elementelement to append
Remarks
MicroStation remembers the mdlElement_add and mdlElement_append functions, so the user can undo them.
Returns
The file position of the element added to the design file. If an error occurs, the function returns zero and the global variable mdlErrno is set to the specific error cause. Possible values for mdlErrno are MDLERR_READONLY, MDLERR_DISKFULL, MDLERR_WRITEINHIBIT, MDLERR_BADELEMENT and MDLERR_WRITEFAILED.
See also
mdlElement_rewrite mdlElement_add
Remarks
Required Library: mdlbltin.lib
int mdlElement_appendAttributes ( MSElementP  pElement,
int  length,
void const *  buffer 
)

Appends attribute information in the attributes buffer to the end of any existing attributes on the element pointed to by element.

The size of the attribute data in words is specified by length.

Parameters
[out]pElementelement pointer
[in]lengthnumber of words of attribute data
[in]bufferbuffer containing the attribute data
Remarks
No validity checking is performed on the attribute information in attributes. All attribute rules should be adhered to.
Returns
Returns no value.
See also
mdlElement_extractAttributes mdlElement_stripAttributes
Remarks
Required Library: mdlbltin.lib
void mdlElement_display ( MSElementP  elementP,
DgnPlatform::DgnDrawMode  drawmode 
)

Displays the MicroStation element pointed to by element in all active views.

It displays non-complex elements that may or may not actually be in the design file. If element is NULL, MicroStation draws the element in dgnBuf.

Parameters
[in]elementPelement to be displayed
[in]drawmodedetermines how MicroStation displays the element. Possible values for drawMode are as follows: drawMode: Meaning of drawMode field DRAW_MODE_Normal: Draw the element in its normal color. ERASE: Erase the element. HILITE: Draw the element in the current highlight color.
Remarks
The mdlElement_displayInSelectedViews function is identical to mdlElement_display except that is has an additional parameter, viewMask, that specifies the views into which the element will be drawn. viewMask is a bit mask, with one bit per view; the lowest bit specifies view 1.
See also
mdlElmdscr_display mdlElmdscr_displayFromFile
Remarks
Required Library: mdlbltin.lib
void mdlElement_displayInSelectedViews ( MSElementP  pElement,
int  drawmode,
int  viewMask 
)

This function is identical to

mdlElement_display except that is has an additional parameter, viewMask, that specifies the views into which the element will be drawn.

viewMask is a bit mask, with one bit per view; the lowest bit specifies view 1.

Parameters
[in]pElementelement to be displayed
[in]drawmodedrawing mode
[in]viewMaskone bit per view
See also
mdlElmdscr_display mdlElmdscr_displayFromFile
Remarks
Required Library: mdlbltin.lib
int mdlElement_extractAttributes ( int *  length,
UInt16 buffer,
MSElementCP  pElement 
)

Extracts attribute information from

the element pointed to by element.

The attributes are copied to the attributes buffer and length is set to the size of the attribute data in words.

Parameters
[out]lengthnumber of words of attribute data
[out]bufferwhere to save the attribute data
[in]pElementelement point
Returns
mdlElement_extractAttributes always returns SUCCESS. *length is zero if no attributes present.
Remarks
The attributes array should be large enough to hold MAX_ATTRIBSIZE words.
element is not changed by mdlElement_extractAttributes.
See also
mdlElement_appendAttributes
Remarks
Required Library: mdlbltin.lib
bool mdlElement_extractFillSymbology ( FillSymbology pFillSymbology,
MSElementP  u 
)

Returns element fill status and fill symbology.

Parameters
[out]pFillSymbologyfill symbology
[in]uelement
Returns
true if an element is filled and false if it is not filled.
Remarks
Required Library: mdlbltin.lib
int mdlElement_extractRange ( DRange3d rangeP,
MSElementCP  pElement 
)

Used to extract the range from an element.

The range is transformed by the current transform if one exists.

Parameters
[out]rangePis the element range.
[in]pElementthe input element.
Returns
SUCCESS if the element range is extracted successfully - an appropriate error code otherwise.
Remarks
Required Library: mdlbltin.lib
Int32 mdlElement_getDisplayStyle ( MSElementCP  pElement)

Query display style linkage on an element.

Parameters
[in]pElementthe element to get the transparency of.
Returns
styline index value of -1 if no style present.
See also
mdlElement_setDisplayStyle
Remarks
Required Library: mdlbltin.lib
int mdlElement_getEffectiveLineStyle ( WCharP  pName,
int  numChars,
LineStyleParamsP  pParamsOut,
MSElementCP  pElementIn,
DgnModelRefP  modelRef,
void *  pElementPathIn,
int  lsIndexIn 
)

The effective line style of an element is the fully resolved line style; in

other words, the style with which it will be drawn.

. If a line style is by level, mdlElement_getEffectiveLineStyle will extract the line style from the level, extract the level override parameters, and then apply the element override parameters. This is different from mdlElement_getLineStyle which will not extract the level line style.

Parameters
[out]pNamename of the line style on this element.
[out]numCharsNumber of chars in pName.
[out]pParamsOutcustom parameters applied to line style on this element.
[in]pElementInpoints to element to get lines style for.
[in]modelRefpoints to the model ref associated with this element.
[in]pElementPathInpoints to the element path (currently unused).
[in]lsIndexInfor multi-line elements, this is the index of the line of interest. Valid values are 1 to 19.
Returns
SUCCESS if the element has a custom line style and it was extracted; ERROR if it is one of the standard eight styles.
See also
mdlElement_getLineStyle
mdlLineStyle_extractEffectiveParams
Remarks
Required Library: mdlbltin.lib
void mdlElement_getEffectiveSymbology ( UInt32 pColorOut,
UInt32 pWeightOut,
Int32 pStyleOut,
LineStyleParamsP  pStyleParamOut,
UInt32 pFillColorOut,
MSElementCP  pElementIn,
const DgnModelRefP  pModelRefIn,
void *  pElementPathIn,
int  viewIndexIn 
)

Extracts the effective color, weight, style and fill color from the element.

If the element's color, weight or style is BYLEVEL or BYCELL, then the function will resolve the BYLEVEL/BYCELL symbology to get symbology of the element as displayed on screen. This function also takes in a "viewIndexIn" parameter. This is used to resolve the element's symbology when "level symbology" is turned on for the view represented by "viewIndex".

Parameters
[out]pColorOutcolor (maybe NULL)
[out]pWeightOutweight (maybe NULL)
[out]pStyleOutstyle (maybe NULL)
[out]pStyleParamOutstyle param - set when the element's style is a custom line style (maybe NULL)
[out]pFillColorOutfill color (maybe NULL)
[in]pElementInelement
[in]pModelRefInelement model ref
[in]pElementPathInelement path (currently unused)
[in]viewIndexInview
See also
mdlElement_getProperties mdlElement_setProperties mdlElmdscr_setProperties mdlElement_getType mdlElement_setSymbology
Remarks
Required Library: mdlbltin.lib
UInt32 mdlElement_getFilePos ( int  type,
DgnModelRefP *  pModelRef 
)

Returns the file position for various elements.

Parameters
[out]pModelRefthe modelRef for the file position returned. pModelRef may be NULL.
[in]typeindicates the type of file position. Possible values are as follows: type: mdlElement_getFilePos returns FILEPOS_EOF: the current end of file position for the master file. FILEPOS_CURRENT: the file position of the current element FILEPOS_FIRST_ELE: the file position of the first element in the master file. FILEPOS_NEXT_ELE: the file position of the next element after the current element. FILEPOS_WORKING_SET: the file position of the working set, if one is active
Returns
The file position of the element indicated by type. If an invalid value is passed for type, the function returns 0xffffffff.
See also
mdlElement_setFilePos
Remarks
Required Library: mdlbltin.lib
StatusInt mdlElement_getFillColor ( UInt32 fillColorP,
MSElementCP  elementP 
)

Gets an element's interior fill color, while

mdlElement_setFillColor sets the existing fill color of an element.

In MicroStation version 5 and later, the interior fill color can differ from the outline color. To check whether the element is filled, set fillColorP to NULL and check the return value. The mdlElmdscr_addFill function sets the fill color to match the outline color.

Parameters
[in]elementPis the element to be queried or whose fill color is to be set. If elementP is not filled, elementP is not modified.
[out]fillColorPis the color index to be assigned to the element.
Returns
SUCCESS if the element is filled and ERROR otherwise
See also
mdlElement_isFilled mdlElmdscr_addFill mdlElmdscr_stripFill mdlElement_setFillColor
Remarks
Required Library: mdlbltin.lib
UInt32 mdlElement_getHeaderFilePos ( UInt32  filePos,
DgnModelRefP  modelRef 
)

Finds the file position for the outermost complex header for the element at the file position specified in the given model.

Parameters
[in]filePosthe file position of the component element
[in]modelRefthe model containing the component element
Returns
The file position of the outermost complex header containing the component element.
Remarks
Required Library: mdlbltin.lib
int mdlElement_getLineStyle ( WCharP  styleNameP,
LineStyleParamsP  paramsP,
MSElementCP  elementP,
DgnModelRefP  modelRef,
int  lsIndex 
)

Retrieves the line style information from an element.

Parameters
[out]styleNamePThe name of the line style will be copied to the buffer pointed to by styleNameP. Pass NULL for this parameter if you do not want the name to be returned.
[out]paramsPIf paramsP is not NULL the parameters extracted from the line style linkage will be copied there.
[in]elementPThe elementP parameter is the address of the element from which the line style linkage will be extracted.
[in]modelRefThe modelRef parameter must indicate the model the element is from. Pass MASTERFILE for the master file or a valid DgnModelRefP to indicate a different model.
[in]lsIndexline index for multi-line elements.
Remarks
If elementP is a multi-line element it can contain up to nineteen different line styles; one for each of the sixteen possible profile lines, one for each end cap, and one for all joint lines. A value of 0 for lsIndex indicates the default line style used for all components that do not specify overrides. Values from 1 - 16 indicate the corresponding profile lines 1 - 16 (or 0 - 15 zero based). A value of 17 indicates the origin cap, 18 indicates the end cap and 19 indicates the line style used for joint lines.
Returns
SUCCESS if the element used a custom line style and the information was extracted successfully. Otherwise an error status is returned.
See also
mdlElement_setLineStyle
mdlElement_getEffectiveLineStyle
Remarks
Required Library: mdlbltin.lib
int mdlElement_getLock ( bool *  pLockFlagOut,
bool *  pEffectiveLockFlagOut,
DgnModelRefP  modelRefIn,
MSElementCP  pElementIn 
)

Used to get the lock values of the specified element.

Parameters
[out]pLockFlagOutis the element's lock flag value, either true or false.
[out]pEffectiveLockFlagOutindicates whether the element is "effectively" locked. If the lock flag of the level the element resides on is set, the element is effectively locked.
[in]modelRefInindicates the model that contains the specified element.
[in]pElementInis the element to query.
Returns
SUCCESS
See also
mdlElement_isEffectivelyLocked
Remarks
Required Library: mdlbltin.lib
void mdlElement_getProperties ( UInt32 level,
UInt32 ggNum,
DgnPlatform::DgnElementClass *  elmClass,
bool *  locked,
bool *  newElm,
bool *  modified,
bool *  viewIndepend,
bool *  solidHole,
MSElementCP  pElement 
)

Extracts the level, graphic group number,

class, locked status, new status, modified status, view independence status, and solid-hole status from the element pointed to by element.

This function puts the extracted values in the variables pointed to by level, ggNumber, class, locked, new, modified, viewInd and solidHole. If parameters other than element are NULL, MicroStation does not fill in the value.

Parameters
[out]levellevel (or NULL)
[out]ggNumgraphic group # (or NULL)
[out]elmClassclass (or NULL)
[out]lockedlocked (or NULL)
[out]newElmnew element (or NULL)
[out]modifiedmodified (or NULL)
[out]viewIndependview independent (or NULL)
[out]solidHolesolid/hole (or NULL)
[in]pElementelement
See also
mdlElement_getSymbology mdlElement_setSymbology mdlElement_getType mdlElmdscr_setProperties mdlElement_setProperties mdlElmdscr_getProperties
Remarks
Required Library: mdlbltin.lib
void mdlElement_getSymbology ( UInt32 color,
UInt32 weight,
Int32 style,
MSElementCP  el 
)

Extracts the color, weight and style from the element pointed to by element.

This function puts the extracted values in the variables pointed to by color, weight and style. If parameters other than element are NULL, MicroStation does not fill in the value. If the color, weight and style of the element are by the level (BYLEVEL) or by cell (BYCELL) then the values returned will be equal to the constants: COLOR_BYLEVEL COLOR_BYCELL STYLE_BYLEVEL STYLE_BYCELL WEIGHT_BYLEVEL WEIGHT_BYCELL

Parameters
[out]colorcolor (or NULL)
[out]weightweight (or NULL)
[out]stylestyle (or NULL)
[in]elelement
See also
mdlElement_getProperties mdlElement_setProperties mdlElmdscr_setProperties mdlElement_getType mdlElement_setSymbology mdlElement_getEffectiveSymbology
Remarks
Required Library: mdlbltin.lib
double mdlElement_getTransparency ( MSElementCP  pElement)

Query display transparency linkage on an element.

Parameters
[in]pElementthe element to get the transparency of.
Returns
transparency value or 0 if no transparency linkage is present.
See also
mdlElmdscr_setTransparency mdlElement_getTransparency
Remarks
Required Library: mdlbltin.lib
int mdlElement_getType ( MSElementCP  el)

Returns the type of the element pointed

to by element.

Parameters
[in]elelement
Returns
The Element type values are defined in mselems.h. For example, for an ellipse element, the mdlElement_getType function returns ELLIPSE_ELM.
See also
mdlElement_getProperties mdlElement_setProperties mdlElmdscr_setProperties
Remarks
Required Library: mdlbltin.lib
bool mdlElement_hasLineStyle ( MSElementCP  elementP)

Used to test the specified element to

see whether a line style other than one of the standard eight styles (style 0 through 7) has been applied to it.

If the style is applied BYLEVEL, the style is obtained from the level on which the element resides, but the same rule is applied.

Parameters
[in]elementPpoints to the element to be tested.
Returns
false if the style is one of the standard eight styles, true if the style is anything else.
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isEffectivelyLocked ( DgnModelRefP  modelRefIn,
MSElementCP  pElement 
)

Used to determine whether

the specified element is effectively locked.

An element is "effectively" locked if its lock flag is set, or if the lock flag of the level the element resides on is set.

Parameters
[in]modelRefInindicates the model that contains the specified element.
[in]pElementis the element to query.
Returns
true if the element is effectively locked, otherwise false.
See also
mdlElement_getLock mdlElementRef_isEffectivelyLocked
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isEffectivelyVisible ( MSElementCP  pElementIn,
const DgnModelRefP  pModelRefIn,
int  viewIndexIn 
)

Check if an element is effectively visible - considers if the level that the element is ON is also visible.

Parameters
[in]pElementInelement
[in]pModelRefInelement model ref
[in]viewIndexInview
Returns
true if the element is visible, else false
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isFilled ( MSElementCP  el)

Returns element fill status.

Parameters
[in]elthe input element
Returns
true if an element is filled and false if it is not filled.
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isVisible ( MSElementCP  pElementIn)

Check if an element is visible.

Parameters
[in]pElementInelement
Returns
true if the element is visible, else false
Remarks
Required Library: mdlbltin.lib
int mdlElement_offset ( MSElementP  out,
MSElementP  in,
DPoint3dP  offset,
bool  allowSizeChange = false 
)

Moves the element in by the distance given by offset and places the result in out.

in and out can point to the same element. The distance is given in the current coordinate system if one exists.

Parameters
[out]outmodified element
[in]inoriginal element
[in]offsetdistance to transform element
[in]allowSizeChangetrue if output element points to a full size MSElement to allow output size to be greater than input element size.
Returns
SUCCESS if the element is transformed properly and ERROR otherwise.
Remarks
Since the transformation matrix for mdlElement_transform includes translation, the mdlElement_offset function is technically unnecessary and just provided for convenience.
See also
mdlElement_transform
int mdlElement_read ( MSElementP  pElement,
DgnModelRefP  modelRef,
UInt32  filepos 
)

Reads an element from a design file to the memory

pointed to by element.

element should point to an MSElement structure so it is large enough to hold the largest MicroStation element.

Parameters
[out]pElementthe buffer to read the element into.
[in]modelRefindicates the model that is the source of the element information. This can be MASTERFILE for the current model, or a DgnModelRefP obtained through a function call.
[in]fileposis the element's file position.
Returns
SUCCESS if an element is read into element. If modelRef is invalid, the function returns MDLERR_BADFILENUMBER. If filePos points to the end of file, it returns MDLERR_ENDOFFILE.
See also
mdlScan_file
Remarks
Required Library: mdlbltin.lib
UInt32 mdlElement_rewrite ( MSElementP  newElem,
MSElementP  oldElem,
UInt32  filePos 
)

Overwrites an existing MicroStation element with a new element

pointed to by newElem at file position filePos.

Parameters
[in]newElemthe new state of the element to be written to the file
[in]oldElemthis parameter is ignored, and is only included for pre-V8 compatibility. MicroStation always checks against existing element in cache.
[in]filePosthe filepos within the master file for this element.
Remarks
If the two elements have different sizes, MicroStation deletes the old one and appends the new element to the end of the file. Otherwise, it overwrites the old element at the same file position.
NOTES:This function can only be used to rewrite a single non-complex element. An attempt to write a component of a complex element will fail (return 0), and set mdlErrno to signify the problem.

All write-to-file asynchs will be called with a copy of the element, so it is possible that the element actually written to the file may differ from the one passed in.

Remarks
The mdlElement_rewrite function is undoable.
Returns
The file position of the element added to the design file. If the two elements are the same size, the element will be rewritten in place (return value will be the same as filePos.)
Remarks
If an error occurs, this function returns zero and the global variable mdlErrno is set to the specific error cause. Possible values for mdlErrno are MDLERR_READONLY, MDLERR_DISKFULL, MDLERR_WRITEINHIBIT, MDLERR_BADELEMENT and MDLERR_WRITEFAILED.
See also
mdlElement_add mdlElement_append
Remarks
Required Library: mdlbltin.lib
StatusInt mdlElement_setDisplayStyle ( MSElementP  pElement,
Int32  styleIndex 
)

Add display style linkage to an element.

Parameters
[in]pElementthe element to add display style linkage to.
[in]styleIndexthe display value to set. (-1 to set no display style).
Returns
SUCCESS if the linkage is added to the element.
See also
mdlElement_getDisplayStyle
Remarks
Required Library: mdlbltin.lib
int mdlElement_setFilePos ( int  type,
DgnModelRefP  modelRef,
UInt32  position 
)

Sets the file position for various elements.

Parameters
[in]positionis the file position to be set and modelRef is a DgnModelRefP indicating the model for that file position. If you do not want to change the model reference, pass -1 for modelRef.
[in]typeindicates the type of file position to be set. Possible values are as follows: type: mdlElement_setFilePos sets FILEPOS_CURRENT: the file position of the current element. FILEPOS_NEXT_ELE: the file position of the next element. (Eliminated in V8) FILEPOS_WORKING_WINDOW: the file position of the working window.
[in]modelRefmodel
Remarks
Some file positions returned by mdlElement_getFilePos are read-only and cannot be set with mdlElement_setFilePos.
Returns
SUCCESS if the indicated file position is set, -1 if an invalid type is passed.
See also
mdlElement_getFilePos
Remarks
Required Library: mdlbltin.lib
StatusInt mdlElement_setFillColor ( MSElementP  elementP,
UInt32  fillColor 
)

Sets an element's interior fill color, while mdlElement_getFillColor queries the existing fill color of an element.

In MicroStation version 5 and later, the interior fill color can differ from the outline color. To check whether the element is filled, set fillColorP to NULL and check the return value.The mdlElmdscr_addFill function sets the fill color to match the outline color.

Parameters
[in,out]elementPis the element to be queried or whose fill color is to be set. If elementP is not filled, elementP is not modified.
[in]fillColoris the color index to be assigned to the element.
Returns
SUCCESS if the fill color is set successfully.
See also
mdlElement_isFilled mdlElmdscr_addFill mdlElmdscr_stripFill
Remarks
Required Library: mdlbltin.lib
int mdlElement_setLineStyle ( MSElementP  pElement,
DgnModelRefP  modelRef,
int  lsIndex,
WCharCP  styleNameP,
LineStyleParamsP  paramsP 
)

Sets the line style of the element pointed to by elementP to the new MicroStation line style defined by pStyleName and pParams.

Setting the element line style involves creating a line style attribute linkage and attaching it to the element. The element must be small enough to accommodate the new line style linkage and the buffer pointed to by pElement must be large enough to accommodate the new linkage.

Parameters
[out]pElementcontains the address of the element to be modified.
[in]modelRefindicates which model the element is to be placed in. This can be set to MASTERFILE to indicate the active model.
[in]lsIndexIf pElement is a multi-line element it can contain up to nineteen different line styles; one for each of the sixteen possible profile lines, one for each end cap, and one for all joint lines. A value of 0 for lsIndex indicates the default line style used for all components that do not specify overrides. Values from 1 - 16 indicate the corresponding profile lines 1 - 16 (or 0 - 15 zero based). A value of 17 indicates the origin cap, 18 indicates the end cap and 19 indicates the line style used for joint lines.
[in]styleNamePspecifies the name of the line style that will be attached to the element pElement. This may not be NULL.
[in]paramsPIf paramsP is not NULL the parameters will be used for the element. If paramsP is NULL, the active parameters will be used.
Returns
SUCCESS if the operation was completed, otherwise an error status is returned.
See also
mdlElement_getLineStyle
Remarks
Required Library: mdlbltin.lib
void mdlElement_setProperties ( MSElementP  el,
UInt32 const *  level,
UInt32 const *  ggNum,
DgnPlatform::DgnElementClass const *  elementClass,
bool const *  locked,
bool const *  newElm,
bool const *  modified,
bool const *  viewIndepend,
bool const *  solidHole 
)

Changes the level, graphic group number, class, locked status, new status,

modified status, view independence status, and solid-hole status in the element pointed to by element.

This function changes these values to the values pointed to by level, ggNum, elementClass, locked, newElm, modified, viewIndpend and solidHole. If parameters other than element are NULL, MicroStation does not change the value in element.

Parameters
[in,out]elelement to set properties on
[in]levellevel (or NULL)
[in]ggNumgraphic group # (or NULL)
[in]elementClassclass (or NULL)
[in]lockedlocked (or NULL)
[in]newElmnew element (or NULL)
[in]modifiedmodified (or NULL)
[in]viewIndependview independent (or NULL)
[in]solidHolesolid/hole (or NULL)
See also
mdlElement_getSymbology mdlElement_setSymbology mdlElement_getType mdlElmdscr_setProperties mdlElement_getProperties
Remarks
Required Library: mdlbltin.lib
void mdlElement_setSymbology ( MSElementP  el,
UInt32 const *  color,
UInt32 const *  weight,
Int32 const *  style 
)

Changes the color, weight, and

style in the element pointed to by element to the values pointed to by color, weight and style.

If parameters other than el are NULL, MicroStation does not change the value in element.

Parameters
[in,out]elelement
[in]colorcolor (or NULL)
[in]weightweight (or NULL)
[in]stylestyle (or NULL)
See also
mdlElement_getProperties mdlElement_setProperties mdlElmdscr_setProperties mdlElement_getSymbology mdlElement_getType
Remarks
Required Library: mdlbltin.lib
StatusInt mdlElement_setTransparency ( MSElementP  pElement,
double  transparency 
)

Add display transparency linkage to an element.

Parameters
[in]pElementthe element to add transparency linkage to.
[in]transparencythe transparency value to set.
Returns
SUCCESS if the linkage is added to the element.
See also
mdlElmdscr_setTransparency mdlElement_getTransparency
Remarks
Required Library: mdlbltin.lib
void mdlElement_stripAttributes ( MSElementP  out,
MSElementP  in 
)

Strips attribute information from the

input element in and puts the result in out.

in and out can point to the same element.

Parameters
[out]outelement with all attributes removed
[in]inelement with attributes
Remarks
Certain element types (CMPLX_STRING_ELM and CMPLX_SHAPE_ELM) must always have attributes. mdlElement_stripAttributes does not remove such required attributes.
See also
mdlElement_appendAttributes mdlElement_extractAttributes mdlDB_detachAttributesElement mdlDB_detachAttributesDscr
Remarks
Required Library: mdlbltin.lib
int mdlElement_stroke ( DPoint3dP *  points,
int *  nPoints,
MSElementP  el,
double  tol 
)

Strokes the element pointed to by <code>el</code> into

vectors in an array pointed to by points.

This array should be the address of a pointer to a DPoint3d structure. MicroStation allocates the memory for the vectors and returns the starting address in points. The application programmer frees this memory when it is no longer needed. The number of points in the array is returned in numPoints.

Parameters
[out]pointspoint array allocation
[out]nPointsnumber of points in points
[in]elelement to be stroked
[in]tolis the maximum distance in UORs between the actual curve and the approximating vectors for curved elements.
Returns
SUCCESS if element is stroked and points and numPoints are valid. ERROR if element is not valid.
See also
mdlElmdscr_stroke
Remarks
Required Library: mdlbltin.lib
int mdlElement_transform ( MSElementP  out,
MSElementP  in,
TransformP  transform,
bool  allowSizeChange = false 
)

Transforms an element by the supplied transformation matrix and places the result in out.

in and out can point to the same element. The transformation matrix relates to the current coordinate system if one exists.

Parameters
[out]outtransformed element
[in]inoriginal element
[in]transformtransformation matrix
[in]allowSizeChangetrue if output element points to a full size MSElement to allow output size to be greater than input element size.
Returns
SUCCESS if the element is transformed properly and ERROR if the resulting element is beyond the design plane.
Remarks
This function remains to support the migration of old application code. A MSElement is insufficient to encapsulate newer concepts such as element handlers and XAttributes. Valid uses of mdlElement_transform are limited to newly created non-complex elements as in the following contrived example:
static void myLegacyCreateFunc (DPoint3dP endPoints, TransformP transform)
{
MSElement elm;
mdlLine_create (&elm, NULL, endPoints);
mdlElement_transform (&elm, &elm, transform, true); // NOTE: Could have easily transformed points instead...
}
It is not correct or useful to replace mdlElement_transform with calls to mdlElmdscr_new/mdlElmdscr_transform as the descriptor will still be missing information about the element handler and it's XAttributes. New code should use methods based on ElementHandle.
static StatusInt transformElement (EditElementHandleR eeh, TransformInfoCR tInfo)
{
// NOTE: Does not apply mdlCurrTrans...
return eeh.GetHandler ().ApplyTransform (eeh, tInfo);
}
StatusInt mdlElement_undoableDelete ( MSElementP  pElement,
UInt32  filePos,
bool  display 
)

Deletes the element pointed to by

element at file position filePos.

MicroStation needs the element to save in the undo buffer. If you do not have a copy of the element when you want to delete it, pass NULL for element and MicroStation will reread the element from the file. This process adds overhead to mdlElement_undoableDelete, so always pass the element if it is known.

Parameters
[in]pElementelement to delete (or NULL)
[in]filePosfilepos of element
[in]displaytrue = erase from screen
Remarks
If display is true, MicroStation erases the element from the screen as it deletes it.
Returns
SUCCESS if element is deleted successfully or an error code otherwise. Possible return values are MDLERR_READONLY, MDLERR_WRITEINHIBIT, MDLERR_BADELEMENT and MDLERR_MODIFYCOMPLEX.
See also
mdlElmdscr_undoableDelete
Remarks
Required Library: mdlbltin.lib
bool mdlElementRef_checkLevelLock ( ElementRefP  elemRef,
DgnModelRefP  modelRef 
)

Determine whether an ElementRefP is on a level that is not the active level while the Level Lock is active.

Parameters
[in]elemRefelementRef to test
[in]modelRefindicates the model that contains the specified element.
Returns
true if the element should be considered locked because it is on a level that is not the active level while level lock is active, otherwise false.
See also
mdlmdlElementRef_isLocked
bool mdlElementRef_isEffectivelyLocked ( DgnModelRefP  modelRef,
ElementRefP  elemRef,
bool  checkChildren 
)

Determine whether an ElementRefP is effectively locked.

An element is "effectively" locked if its lock flag is set, or if the lock flag of the level the element resides on is set. Optionally, this function will check to see whether any child elements of the ElementRefP are effectively locked.

Parameters
[in]modelRefindicates the model that contains the specified element.
[in]elemRefelementRef to test
[in]checkChildrenif true, return true if ANY child of this elementRef is effectively locked.
Returns
true if the element is effectively locked, otherwise false.
See also
mdlElement_isEffectivelyLocked
bool mdlElementRef_isLocked ( DgnModelRefP  modelRef,
ElementRefP  elemRef,
bool  checkChildren 
)

Determine whether an ElementRefP or (optionally) any of it's children, has it's lock bit set.

Parameters
[in]modelRefindicates the model that contains the specified element.
[in]elemRefelementRef to test
[in]checkChildrenif true, return true if ANY child of this elementRef is locked.
Returns
true if the element (or one of it's children) is locked, otherwise false.
See also
mdlElementRef_isEffectivelyLocked
void mdlElmdscr_getProperties ( DgnPlatform::LevelId *  level,
UInt32 ggNum,
DgnPlatform::DgnElementClass *  dgnClass,
bool *  locked,
bool *  newElm,
bool *  modified,
bool *  viewIndepend,
bool *  solidHole,
MSElementDescrCP  edP 
)

Queries the level, element class, graphic group, and other properties of the element desciptor pointed to by edP.

Pass NULL for parameters you are not interested in.

Parameters
[out]levellevel (or NULL)
[out]ggNumgraphic group # (or NULL)
[out]dgnClassclass (or NULL)
[out]lockedlocked (or NULL)
[out]newElmnew element (or NULL)
[out]modifiedmodified (or NULL)
[out]viewIndependview independent (or NULL)
[out]solidHolesolid/hole (or NULL)
[in]edPelement
Remarks
New code should use methods based on ElementHandle.
static void getProperties (ElementHandleCR eh, LevelId& level, DgnElementClass& elmClass, UInt32& gg, bool& locked)
{
ElementPropertiesGetterPtr propGetter = ElementPropertiesGetter::Create (eh);
level = propGetter->GetLevel ();
elmClass = propGetter->GetElementClass ();
gg = ElementPropertiesGetter::GetGraphicGroup (eh);
locked = ElementPropertiesGetter::GetLocked (eh);
}
For solid/hole status which is element specific, see IAreaFillPropertiesQuery::GetAreaType. For viewIndependent status which is element specific, see IsCellQuery::IsPointCell and TextBlock. The new/modified flags are not useful, there is no reason to query these.
See also
mdlElmdscr_setProperties
Remarks
Required Library: mdlbltin.lib
StatusInt mdlElmdscr_setDisplayPriority ( MSElementDescrH  edPP,
Int32  priority 
)

Set display priority of an element descriptor.

Parameters
[in]edPPthe element descriptor to set the display priority of.
[in]prioritythe priority value to set.
Returns
SUCCESS if priority set, or element isn't suitable (3d).
Remarks
Required Library: mdlbltin.lib
StatusInt mdlElmdscr_setTransparency ( MSElementDescrH  edPP,
double  transparency 
)

Add display transparency an element descriptor.

Parameters
[in]edPPthe element descriptor to add transparency linkages to.
[in]transparencythe transparency value to set.
Returns
SUCCESS if the linkages are added to the elements.
See also
mdlElement_setTransparency mdlElement_getTransparency
Remarks
Required Library: mdlbltin.lib

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