Functions
TransientElements

Functions

TransDescrP mdlTransient_addElement (TransDescrP tEdP, MSElementP elementP, int snappable, long viewMask, int displayMode, bool displayFirst, bool atHead, bool initialDisplay)
 
Adds an element to an existing transient

descriptor (tEdP), or create a new transient descriptor if tEdP is NULL. More...

 
TransDescrP mdlTransient_addElemDescr (TransDescrP tedP, MSElementDescrCP edP, int snappable, long viewMask, int displayMode, bool displayFirst, bool atHead, bool initialDisplay)
 Adds an element descriptor to an existing transient descriptor (tEdP), or creates a new transient descriptor if tEdP is NULL. More...
 
TransDescrP mdlTransient_addElemDescrExt (TransDescrP tedP, MSElementDescrCP edP, long viewMask, int displayMode, int priority, bool initialDisplay, UInt32 flags, int overrideColor, int overrideMenuColor, int overrideStyle, int overrideWeight, DgnModelRefP modelRef)
 Adds an element descriptor to an existing transient descriptor (tEdP), or creates a new transient descriptor if tEdP is NULL, allowing some additional parameters over mdlTransient_addElemDescr. More...
 
TransDescrP mdlTransient_replaceElement (TransDescrP tEdP, MSElementP elementP, int snappable, long viewMask, int displayMode, bool displayFirst, bool atHead, bool initialDisplay)
 
Deletes the transient descriptor indicated by tEdP,

if non-NULL, and creates a new transient descriptor from the element indicated by elementP. More...

 
TransDescrP mdlTransient_replaceElemDescr (TransDescrP tEdP, MSElementDescrCP edP, int snappable, long viewMask, int displayMode, bool displayFirst, bool atHead, bool initialDisplay)
 Deletes the transient descriptor indicated by tEdP, if non-NULL, and creates a new transient descriptor from the element descriptor indicated by edP. More...
 
MSElementDescrCP mdlTransient_returnElemDescr (TransDescrP tEdP)
 Gets pointer to the element descriptor associated with a transient descriptor (tEdP). More...
 
void mdlTransient_free (TransDescrP *freeTedPP, bool eraseDisplay)
 Frees the transient descriptor pointer freeTedPP. More...
 
bool mdlTransient_isValid (TransDescrP tEdP)
 Test if transient element descriptor is still valid. More...
 
ElementRefP mdlTransient_getLastElementRef (TransDescrP tEdP)
 Get the ElementRefP of the last element added to the transient descriptor. More...
 
UInt32 mdlTransient_atOffset (TransDescrP *tEdPP, UInt32 *hdrFilePosP, UInt32 searchFilePos)
 Get the first transient element descriptor found after the specified offset distance from the given header file position. More...
 
void mdlTransient_displaySingleInViews (TransDescrP tEdP, MSElementDescrP edP, int displayMode)
 Displays the contents of the transient element descriptor in the open view windows using the display settings of the specified element descriptor. More...
 
void mdlTransient_normalDisplay (TransDescrP tEdP)
 Sets the specified transient element descriptor to display normally. More...
 
void mdlTransient_eraseDisplay (TransDescrP tEdP, bool checkDrawMode)
 Sets the specified transient element descriptor to be erased. More...
 
void mdlTransient_setViewFlags (TransDescrP tEdP, int viewMask, bool display)
 Modify the views that a transient element will display in. More...
 
TransDescrP mdlTransientElemRef_getTDP (ElementRefP ref)
 Used to get the transient descriptor for the specified elementRef if it is from a transient element. More...
 
MSElementDescrP mdlTransientElemRef_getEDP (ElementRefP ref)
 Used to get the element descriptor for the specified elementRef if it is from a transient element. More...
 

Detailed Description

Function Documentation

TransDescrP mdlTransient_addElemDescr ( TransDescrP  tedP,
MSElementDescrCP  edP,
int  snappable,
long  viewMask,
int  displayMode,
bool  displayFirst,
bool  atHead,
bool  initialDisplay 
)

Adds an element descriptor to an existing transient descriptor (tEdP), or creates a new transient descriptor if tEdP is NULL.

The transient descriptor format is not published or required, as transient descriptors are always referenced by (void) pointers.

Parameters
[in]tedPTED to attach to or NULL for new one
[in]edPelement to add to TED
[in]snappableIf snappable is non-zero, the transient element will be snappable.
[in]viewMaskcontrols the views in which the transient element is displayed, the least significant bit controls the display in view 1, the next bit controls view 2 etc. A view mask of 0x00ff causes the element to be displayed in all views, a mask of 0x0008 causes display in view 4 only.
[in]displayModecontrols the element display mode. Valid display modes are defined in msdefs.h and include DRAW_MODE_Normal, HILITE, ERASE and XORDRAW.
[in]displayFirstIf displayFirst is non-zero, the elements in this transient descriptor are displayed before design file graphics, otherwise the elements are displayed after the design file graphics.
[in]atHeadIf atHead is non-zero, the elements in this transient descriptor are displayed before those in other transient descriptors. Otherwise, all transient elements are displayed in the order they were created.
[in]initialDisplaycontrols the initial display of the element. If initialDisplay is zero, the element is added to the transient descriptor but is not displayed.
Returns
returns a pointer to a transient descriptor or NULL if an error occurs. If tEdP is not NULL and the element is successfully added, tEdP is returned.
See also
mdlTransient_replaceElement mdlTransient_replaceElemDescr mdlTransient_returnElemDescr mdlTransient_free
Remarks
Required Library: mdlbltin.lib
TransDescrP mdlTransient_addElemDescrExt ( TransDescrP  tedP,
MSElementDescrCP  edP,
long  viewMask,
int  displayMode,
int  priority,
bool  initialDisplay,
UInt32  flags,
int  overrideColor,
int  overrideMenuColor,
int  overrideStyle,
int  overrideWeight,
DgnModelRefP  modelRef 
)

Adds an element descriptor to an existing transient descriptor (tEdP), or creates a new transient descriptor if tEdP is NULL, allowing some additional parameters over mdlTransient_addElemDescr.


The transient descriptor format is not published or required, as transient descriptors are always referenced by (void) pointers.

Parameters
[in]tedPTED to attach to or NULL for new one
[in]edPelement to add to TED
[in]viewMaskcontrols the views in which the transient element is displayed, the least significant bit controls the display in view 1, the next bit controls view 2 etc. A view mask of 0x00ff causes the element to be displayed in all views, a mask of 0x0008 causes display in view 4 only.
[in]displayModecontrols the element display mode. Valid display modes are defined in msdefs.h and include DRAW_MODE_Normal, HILITE, ERASE and XORDRAW.
[in]prioritypriority relative to other transients. Lower priorities are drawn first
[in]initialDisplaycontrols the initial display of the element. If initialDisplay is zero, the element is added to the transient descriptor but is not displayed.
[in]flagssee TRANSIENT_FLAG defines in msdefs.f
[in]overrideColoroverride color or -1 for none
[in]overrideMenuColoroverride menu color or -1 for none
[in]overrideStyleoverride style or -1 for none
[in]overrideWeightoverride weight or -1 for none
[in]modelRefthe modelRef, normally MASTERFILE
Returns
returns a pointer to a transient descriptor or NULL if an error occurs. If tEdP is not NULL and the element is successfully added, tEdP is returned.
See also
mdlTransient_replaceElement mdlTransient_replaceElemDescr mdlTransient_returnElemDescr mdlTransient_free
Remarks
Required Library: mdlbltin.lib
TransDescrP mdlTransient_addElement ( TransDescrP  tEdP,
MSElementP  elementP,
int  snappable,
long  viewMask,
int  displayMode,
bool  displayFirst,
bool  atHead,
bool  initialDisplay 
)

Adds an element to an existing transient

descriptor (tEdP), or create a new transient descriptor if tEdP is NULL.

The transient descriptor format is not published or required, as transient descriptors are always referenced by (void) pointers.

Parameters
[in]tEdPTED to attach to or NULL for new one
[in]elementPelement to add to TED
[in]snappableIf snappable is non-zero, the transient element will be snappable.
[in]viewMaskcontrols the views in which the transient element is displayed. The least significant bit controls the display in view 1, the next bit controls view 2 etc. A view mask of 0x00ff causes the element to be displayed in all views, a mask of 0x0008 causes display in view 4 only.
[in]displayModecontrols the element display mode. Valid display modes are defined in msdefs.h and include DRAW_MODE_Normal, HILITE, ERASE and XORDRAW.
[in]displayFirstIf displayFirst is non-zero, the elements in this transient descriptor are displayed before design file graphics, otherwise the elements are displayed after the design file graphics.
[in]atHeadIf atHead is non-zero, the elements in this transient descriptor are displayed before those in other transient descriptors. Otherwise, all transient elements are displayed in the order they were created.
[in]initialDisplaycontrols the initial display of the element. If initialDisplay is zero, the element is added to the transient descriptor but is not displayed.
Returns
returns a pointer to a transient descriptor or NULL if an error occurs. If tEdP is not NULL and the element is successfully added, the functions return tEdP.
See also
mdlTransient_replaceElement mdlTransient_replaceElemDescr mdlTransient_returnElemDescr mdlTransient_free mdlTransient_addElemDescr
Remarks
Required Library: mdlbltin.lib
UInt32 mdlTransient_atOffset ( TransDescrP *  tEdPP,
UInt32 hdrFilePosP,
UInt32  searchFilePos 
)

Get the first transient element descriptor found after the specified offset distance from the given header file position.

Parameters
[out]tEdPPthe transient element descriptor
[in]hdrFilePosPthe header file position
[in]searchFilePosthe offset distance from the header file position to start searching for the first transient element descriptor, if one exists.
Returns
the file position of the first transient element descriptor found, or NULL if no transient element descriptor exists
Remarks
Required Library: mdlbltin.lib
void mdlTransient_displaySingleInViews ( TransDescrP  tEdP,
MSElementDescrP  edP,
int  displayMode 
)

Displays the contents of the transient element descriptor in the open view windows using the display settings of the specified element descriptor.

Parameters
[in]tEdPthe transient element descriptor to display
[in]edPthe element to get the display settings from
[in]displayModethe drawing mode to use when drawing the transient element
Remarks
Required Library: mdlbltin.lib
void mdlTransient_eraseDisplay ( TransDescrP  tEdP,
bool  checkDrawMode 
)

Sets the specified transient element descriptor to be erased.

Parameters
[in]tEdPthe transient element descriptor to erase.
[in]checkDrawModeindicates whether the draw mode will be checked before erasing.
Remarks
Required Library: mdlbltin.lib
void mdlTransient_free ( TransDescrP *  freeTedPP,
bool  eraseDisplay 
)

Frees the transient descriptor pointer freeTedPP.

The pointer is then set to NULL. The transient descriptor must be returned by a previous call to mdlTransient_addElement or mdlTransient_addElemDescr.

Parameters
[in,out]freeTedPPtransient element to free
[in]eraseDisplaytrue to erase display
Remarks
A general purpose transient descriptor is defined by the built-in global variable, msTransientElmP. This transient descriptor is provided for use by primitive commands. It is automatically freed and erased whenever mdlState_startPrimitive is called. It can therefore be used by commands which wish to display graphics while the command is being executed, but a clean up function is not required to clear the graphics if the command is aborted or interrupted.
See also
mdlTransient_replaceElemDescr
Remarks
Required Library: mdlbltin.lib
ElementRefP mdlTransient_getLastElementRef ( TransDescrP  tEdP)

Get the ElementRefP of the last element added to the transient descriptor.

An element placement tool can call this to find out what transient it just created, so that it can avoid accusnapping to it.

Parameters
[in]tEdPthe transient element descriptor to get the last element from
Returns
returns transient ElementRefP or NULL
Remarks
Required Library: mdlbltin.lib
bool mdlTransient_isValid ( TransDescrP  tEdP)

Test if transient element descriptor is still valid.

Parameters
[in]tEdPthe transient element descriptor to test
Returns
returns true if transient is valid.
Remarks
Required Library: mdlbltin.lib
void mdlTransient_normalDisplay ( TransDescrP  tEdP)

Sets the specified transient element descriptor to display normally.

Parameters
[in]tEdPthe transient element descriptor to display in DRAW_MODE_Normal mode
Remarks
Required Library: mdlbltin.lib
TransDescrP mdlTransient_replaceElemDescr ( TransDescrP  tEdP,
MSElementDescrCP  edP,
int  snappable,
long  viewMask,
int  displayMode,
bool  displayFirst,
bool  atHead,
bool  initialDisplay 
)

Deletes the transient descriptor indicated by tEdP, if non-NULL, and creates a new transient descriptor from the element descriptor indicated by edP.

The transient descriptor pointer tEdP must be returned by a previous call to mdlTransient_addElement or mdlTransient_addElemDescr.

Remarks
If successful, the transient descriptor indicated by tEdP is freed, so you should get the new transient descriptor from the return value. If the function is not successful, the return value is NULL and tEdP is not freed. So, you retain the tEdP pointer until you known the outcome.
Be aware that mdlTransient_addElement and mdlTransient_addElemDescr return NULL if they encounter an error, yet this same value will cause mdlTransient_replaceElement and mdlTransient_replaceElemDescr to create a new descriptor. If you pass tEdP directly from one set of functions to the other without checking its value, you may inadvertently create a new transient descriptor.
Parameters
[in]tEdPTED to attach to or NULL for new one
[in]edPelement to add to TED
[in]snappableIf snappable is non-zero, the transient element will be snappable.
[in]viewMaskcontrols the views in which the transient element is displayed, the least significant bit controls the display in view 1, the next bit controls view 2 etc. A view mask of 0x00ff causes the element to be displayed in all views, a mask of 0x0008 causes display in view 4 only.
[in]displayModecontrols the element display mode. Valid display modes are defined in msdefs.h and include DRAW_MODE_Normal, HILITE, ERASE and XORDRAW.
[in]displayFirstIf displayFirst is non-zero, the elements in this transient descriptor are displayed before design file graphics, otherwise the elements are displayed after the design file graphics.
[in]atHeadIf atHead is non-zero, the elements in this transient descriptor are displayed before those in other transient descriptors. Otherwise, all transient elements are displayed in the order they were created.
[in]initialDisplaycontrols the initial display of the element. If initialDisplay is zero, the element is added to the transient descriptor but is not displayed.
Returns
returns a pointer to a transient descriptor or NULL if an error occurs. If tEdP is not NULL and the element is successfully replaced, the functions return tEdP.
Remarks
Required Library: mdlbltin.lib
TransDescrP mdlTransient_replaceElement ( TransDescrP  tEdP,
MSElementP  elementP,
int  snappable,
long  viewMask,
int  displayMode,
bool  displayFirst,
bool  atHead,
bool  initialDisplay 
)

Deletes the transient descriptor indicated by tEdP,

if non-NULL, and creates a new transient descriptor from the element indicated by elementP.

The transient descriptor pointer tEdP must be returned by a previous call to mdlTransient_addElement or mdlTransient_addElemDescr.

Remarks
If successful, the transient descriptor indicated by tEdP is freed, so you should get the new transient descriptor from the return value. If the function is not successful, the return value is NULL and tEdP is not freed. So, you retain the tEdP pointer until you known the outcome.
Be aware that mdlTransient_addElement and mdlTransient_addElemDescr return NULL if they encounter an error, yet this same value will cause mdlTransient_replaceElement and mdlTransient_replaceElemDescr to create a new descriptor. If you pass tEdP directly from one set of functions to the other without checking its value, you may inadvertently create a new transient descriptor.
Parameters
[in]tEdPTED to attach to or NULL for new one
[in]elementPelement to add to TED
[in]snappableIf snappable is non-zero, the transient element will be snappable.
[in]viewMaskcontrols the views in which the transient element is displayed, the least significant bit controls the display in view 1, the next bit controls view 2 etc. A view mask of 0x00ff causes the element to be displayed in all views, a mask of 0x0008 causes display in view 4 only.
[in]displayModecontrols the element display mode. Valid display modes are defined in msdefs.h and include DRAW_MODE_Normal, HILITE, ERASE and XORDRAW.
[in]displayFirstIf displayFirst is non-zero, the elements in this transient descriptor are displayed before design file graphics, otherwise the elements are displayed after the design file graphics.
[in]atHeadIf atHead is non-zero, the elements in this transient descriptor are displayed before those in other transient descriptors. Otherwise, all transient elements are displayed in the order they were created.
[in]initialDisplaycontrols the initial display of the element. If initialDisplay is zero, the element is added to the transient descriptor but is not displayed.
Returns
returns a pointer to a newtransient descriptor or NULL if an error occurs.
See also
mdlTransient_replaceElemDescr
Remarks
Required Library: mdlbltin.lib
MSElementDescrCP mdlTransient_returnElemDescr ( TransDescrP  tEdP)

Gets pointer to the element descriptor associated with a transient descriptor (tEdP).

Parameters
[in]tEdPTED
Returns
returns The element descriptor if found or NULL.
See also
mdlTransient_addElemDescr mdlTransient_replaceElemDescr
Remarks
Required Library: mdlbltin.lib
void mdlTransient_setViewFlags ( TransDescrP  tEdP,
int  viewMask,
bool  display 
)

Modify the views that a transient element will display in.

Parameters
[in]tEdPthe transient element descriptor to change the view display of.
[in]viewMaskviews to apply to the transient element.
[in]displaywhether to update the display of the transient element.
Remarks
Required Library: mdlbltin.lib
MSElementDescrP mdlTransientElemRef_getEDP ( ElementRefP  ref)

Used to get the element descriptor for the specified elementRef if it is from a transient element.

Parameters
[in]refthe ElementRefP to get the transient descriptor for.
Returns
the element descriptor for the elementRef, if the elementRef is from a transient. Otherwise, this function will return NULL.
Remarks
Required Library: mdlbltin.lib
TransDescrP mdlTransientElemRef_getTDP ( ElementRefP  ref)

Used to get the transient descriptor for the specified elementRef if it is from a transient element.

Parameters
[in]refthe ElementRefP to get the transient descriptor for.
Returns
the transient descriptor for the elementRef, if the elementRef is from a transient. Otherwise, this function will return NULL.
Remarks
Required Library: mdlbltin.lib

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