Functions
Element Linkage Functions

Functions

void * mdlLinkage_extractFromElement (void *inLinkBuf, MSElementCP elm, int reqID, UInt32 ddbID, void **convRulesPP, LinkageFunc linkFunc, CallbackArgP userArg)
 The mdlLinkage_extractFromElement function is used to extract one or more linkages from the element pointed to by elemP. More...
 
void * mdlLinkage_extractUsingDescr (void *inLinkBuf, MSElementDescrP elmDscrP, int reqID, UInt32 ddbID, void **convRulesPP, LinkageFunc linkFunc, CallbackArgP userArg, bool complexElms)
 The mdlLinkage_extractUsingDescr function is used to extract one or more linkages from one or more elements in the descriptor elmDscrP. More...
 
int mdlLinkage_deleteFromElement (MSElementP elm, int reqID, UInt32 ddbID, void **convRulesPP, LinkageFunc linkFunc, CallbackArgP userArg)
 The mdlLinkage_deleteFromElement function is used to delete linkage(s) from the element pointed to by elemP. More...
 
int mdlLinkage_deleteUsingDescr (MSElementDescrH elmDscrPP, int reqID, UInt32 ddbID, void **convRulesPP, LinkageFunc linkFunc, CallbackArgP userArg, bool complexElms)
 The mdlLinkage_deleteUsingDescr function is used to delete one or more linkages from one or more elements contained in the descriptor elmDscrPP. More...
 
int mdlLinkage_appendToElement (MSElementP elmP, LinkageHeaderP linkHdrP, void *dataP, UInt32 ddbID, void **convRulesPP)
 The mdlLinkage_appendToElement function is used to append a user attribute linkage to the element pointed to by elemP. More...
 
int mdlLinkage_appendUsingDescr (MSElementDescrH elmDscrPP, LinkageHeaderP linkHdrP, void *dataP, UInt32 ddbID, void **convRulesPP, bool complexElms)
 The mdlLinkage_appendUsingDescr function is used to append a user attribute linkage to one or more of the elements contained in the descriptor elmDscrPP. More...
 
int mdlLinkage_appendDoubleArrayLinkage (MSElementP pElementIn, UShort linkageKey, UInt32 elementCount, const double *pLinkageDoubleArrayIn)
 Appends the specified array of double values as a linkage on the given element. More...
 
int mdlLinkage_setDoubleArrayLinkage (MSElementP pElementIn, UShort linkageKey, UInt32 elementCount, const double *pLinkageDoubleArrayIn)
 Sets the values in an array of doubles already set as a linkage on the specified element. More...
 
int mdlLinkage_extractDoubleArrayLinkageByIndex (UShort *pLinkageKeyOut, double **ppLinkageDoubleArrayOut, UInt32 *pElementCountOut, MSElementCP pElementIn, int linkageIndexIn)
 Extracts an array of double values from the linkage on the specified element. More...
 
int mdlLinkage_extractNamedDoubleArrayLinkageByIndex (double **ppLinkageDoubleArrayOut, UInt32 *pElementCount, MSElementCP pElementIn, UShort linkageKeyIn, int linkageIndexIn)
 Extracts an array of double values from the data linkage of the specified element. More...
 
int mdlLinkage_deleteDoubleArrayLinkage (MSElementP pElementIn, UShort linkageKeyIn, int linkageIndexIn)
 Removes the array of double values as a linkage from the specified element. More...
 
int mdlLinkage_addThicknessToDescr (MSElementDescrH ppDescr, double thickness, DPoint3dP directionP, bool cap)
 Adds a thickness value as a linkage to the specified element. More...
 
int mdlLinkage_extractThickness (double *thicknessP, DPoint3dP directionP, bool *cappedP, MSElementCP elemP)
 Extracts the thickness value from the linkage of the specified element. More...
 
StatusInt mdlLinkage_getClipBoundaryLinkage (RotMatrixP pRMatrix, DPoint3dP pOrigin, bool *pFrontClipOn, double *pZFront, bool *pBackClipOn, double *pZBack, UInt32 *pNPoints, DPoint2d *pPoints, UInt32 maxPoints, MSElementCP pElement)
 This function is used to retrieve data from the clip boundary linkage attached to the given element. More...
 
StatusInt mdlLinkage_deleteClipBoundaryLinkage (MSElementP pElement)
 This function is used to remove the clip boundary linkage from the specified element. More...
 
StatusInt mdlLinkage_setClipBoundaryLinkage (MSElementDescrH ppElementDescr, RotMatrixP pRMatrix, DPoint3dP pOrigin, bool frontClipOn, double zFront, bool backClipOn, double zBack, UInt32 nPoints, DPoint2dP pPoints)
 This function is used to set clip boundary linkage containing the given settings values on the specified element. More...
 
StatusInt mdlLinkage_extractXDataLinkage (byte **ppXDataBufferOut, UInt32 *pXDataSizeOut, MSElementP pElementIn)
 Extract an extended entity data (XData) linkage from element. More...
 
StatusInt mdlLinkage_setXDataLinkage (MSElementDescrH ppElementDescrIO, const byte *pXDataBufferIn, UInt32 xdataSizeIn)
 Set an extended entity data (XData) linkage to element. More...
 
int mdlLinkage_deleteXDataLinkage (MSElementP pElementIn)
 Delete an extended entity data (XData) linkage. More...
 
int mdlLinkage_extractElementIDArrayLinkageByIndex (UShort *linkageKeyOut, DgnPlatform::ElementId **elementIDArrayOut, long *elementIDCountOut, MSElementCP elementIn, int linkageIndexIn)
 Extracts an array of elementID values from the linkage on the specified element. More...
 
int mdlLinkage_extractNamedElementIDArrayLinkageByIndex (DgnPlatform::ElementId **elementIDArrayOut, long *elementIDCountOut, MSElementCP elementIn, UShort linkageKeyIn, int linkageIndexIn)
 Extracts an array of elementID values from the data linkage of the specified element. More...
 
UInt16 mdlLinkage_getWords (LinkageHeaderCP linkHdrP)
 Gets the size of the linkage, in two-byte words. More...
 
int mdlLinkage_setWords (LinkageHeaderP linkHdrP, int wordLength)
 Sets the size of the linkage. More...
 
int mdlLinkage_calculateSize (int bufferSizeIn)
 Calculate the actual size (bytes) of a linkage given the number of bytes of data (including linkage header) that needs to be written into the linkage. More...
 
int mdlLinkage_appendStringLinkage (MSElementP elementIn, UShort linkageKey, WCharCP linkageStringIn)
 This function appends the specified string to the given element as a data linkage using the given key. More...
 
int mdlLinkage_setStringLinkage (MSElementP elementIn, UShort linkageKey, WCharCP linkageStringIn)
 This function sets the given string data linkage on the given element. More...
 
int mdlLinkage_setStringLinkageUsingDescr (MSElementDescrH ppElemDscrIn, UShort linkageKeyIn, WCharCP linkageStringIn)
 This function sets the given string data linkage on the given element descriptor. More...
 
int mdlLinkage_appendStringLinkageUsingDescr (MSElementDescrH ppElemDscrIn, UShort linkageKey, WCharCP linkageStringIn)
 This function appends the given string data linkage to the given element descriptor. More...
 
int mdlLinkage_extractStringLinkageByIndex (UShort *linkageKeyOut, WCharP linkageStringOut, int bufferSize, MSElementCP elementIn, int linkageIndexIn)
 This function extracts the string data from the element linkage with the specified index on the given element. More...
 
int mdlLinkage_extractNamedStringLinkageByIndex (WCharP linkageStringOut, int bufferSizeIn, MSElementCP elementIn, UShort linkageKeyIn, int linkageIndexIn)
 This function extracts the string data from the element linkage with the specified linkage key and index on the given element. More...
 
int mdlLinkage_deleteStringLinkage (MSElementP elementIn, UShort linkageKeyIn, int linkageIndexIn)
 This function is used to delete the specified string linkage data from the specified element. More...
 
int mdlLinkage_appendElementIDArrayLinkage (MSElementP elementIn, UShort linkageKeyIn, UInt32 elementIDCountIn, DgnPlatform::ElementId const *elementIDArrayIn)
 Appends the specified array of elementID values as a linkage on the given element. More...
 
int mdlLinkage_appendElementIDArrayLinkageUsingDescr (MSElementDescrH elementDescrIO, UShort linkageKeyIn, UInt32 elementIDCountIn, DgnPlatform::ElementId const *elementIDArrayIn)
 Appends the specified array of elementID values as a linkage on the given element descriptor. More...
 
int mdlLinkage_deleteElementIDArrayLinkage (MSElementP elementIn, UShort linkageKeyIn, int linkageIndexIn)
 Removes the array of elementID values as a linkage from the specified element. More...
 
int mdlLinkage_setElementIDArrayLinkage (MSElementP elementIn, UShort linkageKeyIn, UInt32 elementIDCountIn, DgnPlatform::ElementId const *elementIDArrayIn)
 Sets the values in an array of elementID already set as a linkage on the specified element. More...
 
int mdlLinkage_setElementIDArrayLinkageUsingDescr (MSElementDescrH elementDescrIO, UShort linkageKeyIn, UInt32 elementIDCountIn, DgnPlatform::ElementId const *elementIDArrayIn)
 Sets the values in an array of elementID already set as a linkage on the specified descriptor. More...
 
int mdlLinkage_extractBitMask (BitMaskP *pBitMaskOut, MSElementCP pElementIn, UShort linkageKeyIn, int linkageIndexIn)
 Extracts the bit mask linkage from the given element. More...
 
int mdlLinkage_setBitMaskUsingDescr (MSElementDescrH ppElemDscrIn, UShort linkageKeyIn, BitMaskCP pBitMaskIn)
 Sets the contents of a bit mask linkage on the given element descriptor. More...
 
int mdlLinkage_setBitMask (MSElementP pElementIn, UShort linkageKey, BitMaskCP pBitMaskIn)
 Sets the contents of a bit mask already appended as a linkage on an element. More...
 
int mdlLinkage_appendBitMask (MSElementP pElementIn, UShort linkageKeyIn, BitMaskCP pBitMaskIn)
 Appends the specified bitmask as a linkage on the given element. More...
 
int mdlLinkage_ensureBitMaskCapacityUsingDescr (MSElementDescrH ppElemDscrIn, UShort linkageKeyIn, int numBitsIn)
 Checks the size of the bit mask linkage on the specified element descriptor. More...
 
int mdlLinkage_deleteBitMask (MSElementP pElementIn, UShort linkageKeyIn, int linkageIndexIn)
 Deletes the bit mask linkage from the specified element. More...
 

Detailed Description

Function Documentation

int mdlLinkage_addThicknessToDescr ( MSElementDescrH  ppDescr,
double  thickness,
DPoint3dP  directionP,
bool  cap 
)

Adds a thickness value as a linkage to the specified element.

Parameters
[in,out]ppDescrthe element descriptor to add the thickness to
[in]thicknessthe thickness value to add to the element
[in]directionPrequired when the element is not defined on a plane
[in]capcap closed elements, true or false
Returns
SUCCESS if the linkage could be added without error
int mdlLinkage_appendBitMask ( MSElementP  pElementIn,
UShort  linkageKeyIn,
BitMaskCP  pBitMaskIn 
)

Appends the specified bitmask as a linkage on the given element.

Parameters
pElementInIN the element to append bitmask linkage to
linkageKeyInIN the linkage to use when appending the bitmask
pBitMaskInIN the bit mask to add as a linkage
Returns
SUCCESS if the linkage could be attached ""
int mdlLinkage_appendDoubleArrayLinkage ( MSElementP  pElementIn,
UShort  linkageKey,
UInt32  elementCount,
const double *  pLinkageDoubleArrayIn 
)

Appends the specified array of double values as a linkage on the given element.

Parameters
[in]pElementInthe element to append the linkage array to
[in]linkageKeythe linkage key to use to append the linkage
[in]elementCountthe number of double values in the array
[in]pLinkageDoubleArrayInthe array of double values to append as a linkage
Returns
SUCCESS If the operation was completed successfully.
int mdlLinkage_appendElementIDArrayLinkage ( MSElementP  elementIn,
UShort  linkageKeyIn,
UInt32  elementIDCountIn,
DgnPlatform::ElementId const *  elementIDArrayIn 
)

Appends the specified array of elementID values as a linkage on the given element.

Element needs to be of sufficient size. Use a dependency linkage to make persistent references to other elements, not this function!

Parameters
elementInIN the element to append the linkage array to
linkageKeyInIN the linkage key to use to append the linkage
elementIDCountInIN the number of elementID values in the array
elementIDArrayInIN the array of elementID values to append as a linkage
Returns
SUCCESS If the operation was completed successfully.
Remarks
Use a dependency linkage to make persistent references to other elements! ""
See also
mdlDependency_addSimpleDependencyLinkageToDescr mdlDependency_appendLinkageUsingDescr mdlDependency_appendLinkage
int mdlLinkage_appendElementIDArrayLinkageUsingDescr ( MSElementDescrH  elementDescrIO,
UShort  linkageKeyIn,
UInt32  elementIDCountIn,
DgnPlatform::ElementId const *  elementIDArrayIn 
)

Appends the specified array of elementID values as a linkage on the given element descriptor.

Use a dependency linkage to make persistent references to other elements, not this function!

Parameters
elementDescrIOIN the element descriptor to append the linkage array to
linkageKeyInIN the linkage key to use to append the linkage
elementIDCountInIN the number of elementID values in the array
elementIDArrayInIN the array of elementID values to append as a linkage
Returns
SUCCESS If the operation was completed successfully.
Remarks
Use a dependency linkage to make persistent references to other elements! ""
See also
mdlDependency_addSimpleDependencyLinkageToDescr mdlDependency_appendLinkageUsingDescr mdlDependency_appendLinkage
int mdlLinkage_appendStringLinkage ( MSElementP  elementIn,
UShort  linkageKey,
WCharCP  linkageStringIn 
)

This function appends the specified string to the given element as a data linkage using the given key.

Parameters
elementInIN the element to which the linkage-string is appended
linkageKeyIN the linkage key to use for the given string data
linkageStringInIN the string to append to the data linkage on the element
Returns
SUCCESS unless the data could not be added to the linkage, then ERROR ""
See also
usmthmdlLinkage_setStringLinkageC usmthmdlLinkage_setStringLinkageUsingDescrC
int mdlLinkage_appendStringLinkageUsingDescr ( MSElementDescrH  ppElemDscrIn,
UShort  linkageKey,
WCharCP  linkageStringIn 
)

This function appends the given string data linkage to the given element descriptor.

Parameters
ppElemDscrInIN the element descriptor to append the linkage-string to
linkageKeyIN the linkage key to use for the string data
linkageStringInIN the linkage string to append
Returns
SUCCESS if the operation was completed successfully, otherwise ERROR. ""
See also
usmthmdlLinkage_appendStringLinkageC usmthmdlLinkage_setStringLinkageC
int mdlLinkage_appendToElement ( MSElementP  elmP,
LinkageHeaderP  linkHdrP,
void *  dataP,
UInt32  ddbID,
void **  convRulesPP 
)

The mdlLinkage_appendToElement function is used to append a user attribute linkage to the element pointed to by elemP.

Parameters
[out]elmPpoints to the element that will receive the linkage.
[in]linkHdrPpoints to a 2 word linkage header that has been filled in by the caller. If the ddbID parameter is provided, then the caller does not have to set the size of the linkage in the linkage header. This function will always convert the linkage header to file format for the caller.
[in]dataPparameter points to the remaining data of the attribute linkage. This will be appended to the linkage header and added to the element. If the caller supplies the ddbID parameter, the data pointed to by linkDataP will first be converted to file format.
[in]ddbIDis the resource ID of a data definition block which describes the structure to be converted. The data definition block is used to convert the linkage data located at linkDataP from internal format to file format. Furthermore, if ddbID is provided, mdlLinkage_appendToElement will automatically pad the linkage out to the necessary 4 word boundary and set the size of the linkage in the linkage header. If ddbID is 0 and convRulesPP is NULL or points to NULL, then it is the caller's responsibility to convert the data and set the linkage size in the linkage header.
[in,out]convRulesPPcan be set in one of 3 ways. If it is set to NULL, it indicates that after ddbID is used to load the data definition resource, the resulting conversion rules produced can be thrown away once the conversion is complete. Set convRulesPP to NULL if you don't intend to convert this type of data very often. Secondly, if convRulesPP is a pointer to NULL, then a pointer to the conversion rules produced from the data definition resource are saved in convRulesPP. Third, convRulesPP, can point to a previously generated set of conversion rules (as described in the second case). In this case, the ddbID parameter is ignored.
Returns
returns SUCCESS if the data was successfully appended.
See also
mdlLinkage_appendUsingDescr mdlCnv_bufferToFileFormat
int mdlLinkage_appendUsingDescr ( MSElementDescrH  elmDscrPP,
LinkageHeaderP  linkHdrP,
void *  dataP,
UInt32  ddbID,
void **  convRulesPP,
bool  complexElms 
)

The mdlLinkage_appendUsingDescr function is used to append a user attribute linkage to one or more of the elements contained in the descriptor elmDscrPP.

Parameters
[in,out]elmDscrPPelement description
[in]linkHdrPpoints to a 2 word linkage header that has been filled in by the caller. If the ddbID parameter is provided, then the caller does not have to set the size of the linkage in the linkage header. This function will always convert the linkage header to file format for the caller.
[in]dataPparameter points to the remaining data of the attribute linkage. This will be appended to the linkage header and added to the element. If the caller supplies the ddbID parameter, the data pointed to by linkDataP will first be converted to file format. For more information, see mdlLinkage_appendToElement.
[in]ddbIDis the resource ID of a data definition block which describes the structure to be converted. The data definition block is used to convert the linkage data located at linkDataP from internal format to file format. Furthermore, if ddbID is provided, this function will automatically pad the linkage out to the necessary 4 word boundary and set the size of the linkage in the linkage header. If ddbID is 0 and convRulesPP is NULL or points to NULL, then it is the caller's responsibility to convert the data and set the linkage size in the linkage header.
[in,out]convRulesPPcan be set in one of 3 ways. If it is set to NULL, it indicates that after ddbID is used to load the data definition resource, the resulting conversion rules produced can be thrown away once the conversion is complete. Set convRulesPP to NULL if you don't intend to convert this type of data very often. Secondly, if convRulesPP is a pointer to NULL, then a pointer to the conversion rules produced from the data definition resource are saved in convRulesPP. Third, convRulesPP, can point to a previously generated set of conversion rules (as described in the second case). In this case, the ddbID parameter is ignored.
[in]complexElmsflag only affects descriptors containing complex elements. If the flag is set to true, all elements of the descriptor will be appended with the linkage. If the flag is set to false, only outermost headers of complex elements will receive the linkage.
Returns
returns SUCCESS if the data was successfully appended.
See also
mdlLinkage_appendToElement mdlCnv_bufferToFileFormat
int mdlLinkage_calculateSize ( int  bufferSizeIn)

Calculate the actual size (bytes) of a linkage given the number of bytes of data (including linkage header) that needs to be written into the linkage.

Parameters
bufferSizeInIN bytes of data that need to be written
Returns
The calculated size of linkage in bytes
See also
usmthmdlLinkage_getWordsC usmtnmdlLinkage_setWordsC ""
int mdlLinkage_deleteBitMask ( MSElementP  pElementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

Deletes the bit mask linkage from the specified element.

Parameters
pElementInIN the element to delete the bitmask linkage from
linkageKeyInIN the linkage key for the bit mask
linkageIndexInIN the index of the bit mask linkage on the element
Returns
SUCCESS if the bitmask linkage was found and deleted successfully ""
StatusInt mdlLinkage_deleteClipBoundaryLinkage ( MSElementP  pElement)

This function is used to remove the clip boundary linkage from the specified element.

Parameters
[in,out]pElementthe element to remove the clip boundary linkage from
Returns
SUCCESS if the linkage could be removed, otherwise ERROR.
See also
mdlLinkage_setClipBoundaryLinkage mdlLinkage_getClipBoundaryLinkage
int mdlLinkage_deleteDoubleArrayLinkage ( MSElementP  pElementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

Removes the array of double values as a linkage from the specified element.

Parameters
[in]pElementInthe element that has the array attached
[in]linkageKeyInthe linkage key of the array
[in]linkageIndexInthe index of the array linkage on the element
Returns
SUCCESS if the array could be found as a linkage on the element and removed
int mdlLinkage_deleteElementIDArrayLinkage ( MSElementP  elementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

Removes the array of elementID values as a linkage from the specified element.

Use a dependency linkage to make persistent references to other elements!

Parameters
elementInIN the element that has the array attached
linkageKeyInIN the linkage key of the array
linkageIndexInIN the index of the array linkage on the element
Returns
SUCCESS if the array could be found as a linkage on the element and removed
Remarks
Use a dependency linkage to make persistent references to other elements! ""
int mdlLinkage_deleteFromElement ( MSElementP  elm,
int  reqID,
UInt32  ddbID,
void **  convRulesPP,
LinkageFunc  linkFunc,
CallbackArgP  userArg 
)

The mdlLinkage_deleteFromElement function is used to delete linkage(s) from the element pointed to by elemP.

Parameters
[in,out]elmpoints to the element from which linkages are (potentially) deleted.
[in]reqIDis the requested linkage ID. A reqID of 0 indicates a DMRS database linkage.
[in]ddbIDis the resource ID of a data definition block which describes the structure to be converted. The data definition block is used to convert the linkage data (starting after the 2 word linkage header) from file format to internal format. If ddbID is 0 and convRulesPP is NULL or points to NULL, then the data portion of the linkage is left in file format. You would use the ddbID parameter to make it easier for linkFunc to inspect the linkages.
[in,out]convRulesPPcan be set in one of 3 ways. If it is set to NULL, it indicates that after ddbID is used to load the data definition resource, the resulting conversion rules produced can be thrown away once the conversion is complete. Set convRulesPP to NULL if you don't intend to convert this type of data very often. Secondly, if convRulesPP is a pointer to NULL, then a pointer to the conversion rules produced from the data definition resource are saved in convRulesPP. Third, convRulesPP, can point to a previously generated set of conversion rules (as described in the second case). In this case, the ddbID parameter is ignored.
[in]linkFuncis a pointer to an optional function that will be called for each linkage encountered with an ID of reqID. The usual purpose of the linkFunc is to decide which linkages should actually be deleted from the element. The function should return true for the linkage to be deleted.
Remarks
The extracted linkage will always have its 2 word header converted to internal format for the convenience of linkFunc. The data portion will also be converted if ddbID was specified in the original call.
Parameters
[in]userArgis passed in to linkFunc unchanged.
Returns
returns the number of linkages that were deleted.
See also
mdlLinkage_deleteUsingDescr mdlCnv_bufferFromFileFormat
int mdlLinkage_deleteStringLinkage ( MSElementP  elementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

This function is used to delete the specified string linkage data from the specified element.

Parameters
elementInIN the element to remove the string linkage data from
linkageKeyInIN the linkage key for the string data
linkageIndexInIN the index of the string data
Returns
SUCCESS if the linkage could be found and removed, otherwise ERROR ""
See also
usmthmdlLinkage_appendStringLinkageC
int mdlLinkage_deleteUsingDescr ( MSElementDescrH  elmDscrPP,
int  reqID,
UInt32  ddbID,
void **  convRulesPP,
LinkageFunc  linkFunc,
CallbackArgP  userArg,
bool  complexElms 
)

The mdlLinkage_deleteUsingDescr function is used to delete one or more linkages from one or more elements contained in the descriptor elmDscrPP.

Parameters
[in,out]elmDscrPPpoints to the element descriptor.
[in]reqIDis the requested linkage ID. A reqID of 0 indicates a DMRS database linkage.
[in]ddbIDis the resource ID of a data definition block which describes the structure to be converted. The data definition block is used to convert the linkage data (starting after the 2 word linkage header) from file format to internal format. If ddbID is 0 and convRulesPP is NULL or points to NULL, then the data portion of the linkage is left in file format. You would use the ddbID parameter to make it easier for linkFunc to inspect the linkages.
[in]convRulesPPcan be set in one of 3 ways. If it is set to NULL, it indicates that after ddbID is used to load the data definition resource, the resulting conversion rules produced can be thrown away once the conversion is complete. Set convRulesPP to NULL if you don't intend to convert this type of data very often. Secondly, if convRulesPP is a pointer to NULL, then a pointer to the conversion rules produced from the data definition resource are saved in convRulesPP. Third, convRulesPP, can point to a previously generated set of conversion rules (as described in the second case). In this case, the ddbID parameter is ignored.
[in]linkFuncis a pointer to an optional function that will be called for each linkage encountered with an ID of reqID. The usual purpose of the linkFunc is to decide which linkages should actually be deleted from the element.
Remarks
The extracted linkage will always have its 2 word header converted to internal format for the convenience of linkFunc. The data portion will also be converted if ddbID was specified in the original call.
Parameters
[in]userArguser params to linkFunc.
[in]complexElmsflag only affects descriptors containing complex elements. If the flag is set to true, all elements of the descriptor containing linkages matching reqID will be passed to linkFunc. If the flag is set to false, only outermost headers of complex elements are eligible.
Remarks
If this function is called with linkFunc set to NULL, the effect is to ignore all elements in the descriptor except the last one containing a linkage matching reqID.
Returns
returns the number of linkages that were deleted.
See also
mdlLinkage_deleteFromElement mdlCnv_bufferFromFileFormat
int mdlLinkage_deleteXDataLinkage ( MSElementP  pElementIn)

Delete an extended entity data (XData) linkage.

Parameters
[in]pElementInelement from which to delete xdata
Returns
SUCCESS if the linkage could be deleted, else ERROR
Remarks
When an XData linkage is deleted, the entire content of extended entity data gets deleted. That is, XData segments of all owners (registered applications) get deleted at once when using this function.
See also
mdlLinkage_extractXDataLinkage mdlLinkage_setXDataLinkage
int mdlLinkage_ensureBitMaskCapacityUsingDescr ( MSElementDescrH  ppElemDscrIn,
UShort  linkageKeyIn,
int  numBitsIn 
)

Checks the size of the bit mask linkage on the specified element descriptor.

Parameters
ppElemDscrInIN OUT the element descriptor on which to set the linkage
linkageKeyInIN the linkage key to use for the bit mask
numBitsInIN the size of the bitmask to ensure in the linkage
Returns
SUCCESS if the bit mask size is acceptable ""
int mdlLinkage_extractBitMask ( BitMaskP *  pBitMaskOut,
MSElementCP  pElementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

Extracts the bit mask linkage from the given element.

Parameters
pBitMaskOutOUT the bit mask extracted from the linkage, must be freed by caller
pElementInIN the element that has the bit mask linkage attached
linkageKeyInIN the linkage key for the bit mask
linkageIndexInIN the index of the bit mask linkage on the element
Returns
SUCCESS if the linkage is found and extracted ""
int mdlLinkage_extractDoubleArrayLinkageByIndex ( UShort pLinkageKeyOut,
double **  ppLinkageDoubleArrayOut,
UInt32 pElementCountOut,
MSElementCP  pElementIn,
int  linkageIndexIn 
)

Extracts an array of double values from the linkage on the specified element.

Parameters
[out]pLinkageKeyOutthe linkage key on the array
[out]ppLinkageDoubleArrayOutthe array of double values on the element
[out]pElementCountOutthe number of elements in the array
[in]pElementInthe element from which to get the array
[in]linkageIndexInthe index of the array in the user data linkage
Returns
SUCCESS if the array was found and retrieved, otherwise ERROR
int mdlLinkage_extractElementIDArrayLinkageByIndex ( UShort linkageKeyOut,
DgnPlatform::ElementId **  elementIDArrayOut,
long *  elementIDCountOut,
MSElementCP  elementIn,
int  linkageIndexIn 
)

Extracts an array of elementID values from the linkage on the specified element.

Use a dependency linkage to make persistent references to other elements!

Parameters
[out]linkageKeyOutthe linkage key on the array
[out]elementIDArrayOutthe array of linkage values on the element
[out]elementIDCountOutthe number of elementIDs in the array
[in]elementInthe element from which to get the array
[in]linkageIndexInthe index of the array in the user data linkage
Returns
SUCCESS if the array was found and retrieved, otherwise ERROR
Remarks
Use a dependency linkage to make persistent references to other elements!
void* mdlLinkage_extractFromElement ( void *  inLinkBuf,
MSElementCP  elm,
int  reqID,
UInt32  ddbID,
void **  convRulesPP,
LinkageFunc  linkFunc,
CallbackArgP  userArg 
)

The mdlLinkage_extractFromElement function is used to extract one or more linkages from the element pointed to by elemP.

Parameters
[out]inLinkBufparameter points to a buffer where the extracted linkage will be stored. The first 2 words of inLinkBufP represents the linkage header and is always converted to internal format for the caller. The remaining portion of inLinkBufP is also converted to internal format if the ddbID parameter is provided, or if *convRulesPP points to a previously generated set of conversion rules. If the caller needs to process multiple linkages in the element, inLinkBufP is set to NULL and a linkFunc function pointer is provided instead.
[in]elmpoints to the element from which the linkage is extracted. The element is not affected by this function.
[in]reqIDis the requested linkage ID. A reqID of 0 indicates a DMRS database linkage.
[in]ddbIDis the resource ID of a data definition block which describes the structure to be converted. The data definition block is used to convert the linkage data (starting after the 2 word linkage header) from file format to internal format. If ddbID is 0 and convRulesPP is NULL or points to NULL, then the data portion of the linkage is left in file format.
[in,out]convRulesPPcan be set in one of 3 ways. If it is set to NULL, it indicates that after ddbID is used to load the data definition resource, the resulting conversion rules produced can be thrown away once the conversion is complete. Set convRulesPP to NULL if you don't intend to convert this type of data very often. Secondly, if convRulesPP is a pointer to NULL, then a pointer to the conversion rules produced from the data definition resource are saved in convRulesPP. Third, convRulesPP, can point to a previously generated set of conversion rules (as described in the second case). In this case, the ddbID parameter is ignored.
[in]linkFuncis a pointer to a optional function that will be called for each linkage encountered with an ID of reqID. It should return false to continue processing, true to stop.
Remarks
The extracted linkage will always have its 2 word header converted to internal format for the convenience of linkFunc. The data portion will also be converted if ddbID was specified in the original call.
Parameters
[in]userArgis passed in to linkFunc unchanged.
Returns
returns a pointer to the last element linkage processed in elm or NULL if no linkage was found. The linkage pointer returned points to the raw file format linkage.
See also
mdlLinkage_extractUsingDescr mdlCnv_bufferFromFileFormat
int mdlLinkage_extractNamedDoubleArrayLinkageByIndex ( double **  ppLinkageDoubleArrayOut,
UInt32 pElementCount,
MSElementCP  pElementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

Extracts an array of double values from the data linkage of the specified element.

Parameters
[out]ppLinkageDoubleArrayOutthe linkage array
[out]pElementCountthe number of doubles in the array
[in]pElementInthe element to get the array from
[in]linkageKeyInthe linkage key to use to get the array
[in]linkageIndexInthe index of the linkage containing the array
Returns
SUCCESS if the array is found on the element and returned successfully
int mdlLinkage_extractNamedElementIDArrayLinkageByIndex ( DgnPlatform::ElementId **  elementIDArrayOut,
long *  elementIDCountOut,
MSElementCP  elementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

Extracts an array of elementID values from the data linkage of the specified element.

Use a dependency linkage to make persistent references to other elements!

Parameters
[out]elementIDArrayOutthe array of linkage values on the element
[out]elementIDCountOutthe number of elementIDs in the array
[in]elementInthe element from which to get the array
[in]linkageKeyInthe linkage key to use to get the array
[in]linkageIndexInthe index of the linkage containing the array
Returns
SUCCESS if the array is found on the element and returned successfully
Remarks
Use a dependency linkage to make persistent references to other elements!
int mdlLinkage_extractNamedStringLinkageByIndex ( WCharP  linkageStringOut,
int  bufferSizeIn,
MSElementCP  elementIn,
UShort  linkageKeyIn,
int  linkageIndexIn 
)

This function extracts the string data from the element linkage with the specified linkage key and index on the given element.

Parameters
linkageStringOutOUT the linkage string
bufferSizeInIN the size of the "linkageStringOut" buffer
elementInIN the element to extract the string linkage from
linkageKeyInIN the linkage key for the string data to extract
linkageIndexInIN the index of the string linkage to extract
Returns
SUCCESS if the string data could be extracted, otherwise ERROR ""
See also
usmthmdlLinkage_extractStringLinkageByIndexC
int mdlLinkage_extractStringLinkageByIndex ( UShort linkageKeyOut,
WCharP  linkageStringOut,
int  bufferSize,
MSElementCP  elementIn,
int  linkageIndexIn 
)

This function extracts the string data from the element linkage with the specified index on the given element.

Parameters
linkageKeyOutOUT the linkage key for the string data of the given index
linkageStringOutOUT the linkage string
bufferSizeIN the size of the "linkageStringOut" buffer
elementInIN the element to extract the string linkage from
linkageIndexInIN the index of the string linkage to extract
Returns
SUCCESS if the string data could be extracted, otherwise ERROR ""
See also
usmthmdlLinkage_extractNamedStringLinkageByIndexC
int mdlLinkage_extractThickness ( double *  thicknessP,
DPoint3dP  directionP,
bool *  cappedP,
MSElementCP  elemP 
)

Extracts the thickness value from the linkage of the specified element.

Parameters
[out]thicknessPthe thickness value extracted
[out]directionPonly when element is not defined on a plane
[out]cappedPif capped element was specified when thickness was attached
[in]elemPelement to extract thickness from
Returns
SUCCESS if the thickness linkage was found on the element and returned
void* mdlLinkage_extractUsingDescr ( void *  inLinkBuf,
MSElementDescrP  elmDscrP,
int  reqID,
UInt32  ddbID,
void **  convRulesPP,
LinkageFunc  linkFunc,
CallbackArgP  userArg,
bool  complexElms 
)

The mdlLinkage_extractUsingDescr function is used to extract one or more linkages from one or more elements in the descriptor elmDscrP.

Parameters
[out]inLinkBufparameter points to a buffer where the extracted linkage will be stored. The first 2 words of inLinkBufP represents the linkage header and is always converted to internal format for the caller. The remaining portion of inLinkBufP is also converted to internal format if the ddbID parameter is provided, or if *convRulesPP points to a previously generated set of conversion rules. If the caller needs to process multiple linkages in the element, inLinkBufP is set to NULL and a linkFunc function pointer is provided instead.
[in]elmDscrPpoints to the element descriptor from which the linkages will be extracted.
[in]reqIDis the requested linkage ID. A reqID of 0 indicates a DMRS database linkage.
[in]ddbIDis the resource ID of a data definition block which describes the structure to be converted. The data definition block is used to convert the linkage data (starting after the 2 word linkage header) from file format to internal format. If ddbID is 0 and convRulesPP is NULL or points to NULL, then the data portion of the linkage is left in file format.
[in]convRulesPPcan be set in one of 3 ways. If it is set to NULL, it indicates that after ddbID is used to load the data definition resource, the resulting conversion rules produced can be thrown away once the conversion is complete. Set convRulesPP to NULL if you don't intend to convert this type of data very often. Secondly, if convRulesPP is a pointer to NULL, then a pointer to the conversion rules produced from the data definition resource are saved in convRulesPP. Third, convRulesPP, can point to a previously generated set of conversion rules (as described in the second case). In this case, the ddbID parameter is ignored.
[in]linkFuncis a pointer to an optional function that will be called for each linkage encountered with an ID of reqID. It should return false to continue processing, true to stop.
Remarks
The extracted linkage will always have its 2 word header converted to internal format for the convenience of linkFunc. The data portion will also be converted if ddbID was specified in the original call.
If this function is called with linkFunc set to NULL, the effect is to ignore all elements in the descriptor except the last one containing a linkage matching reqID.
Parameters
[in]userArgis passed in to linkFunc unchanged.
[in]complexElmsis a flag only affecting descriptors containing complex elements. If the flag is set to true, all elements of the descriptor containing linkages matching reqID will be passed to linkFunc. If the flag is set to false, only outermost headers of complex elements are eligible.
Returns
returns a pointer to the last element linkage processed from the descriptor or NULL if no linkage was found. The linkage pointer returned points to the raw file format linkage.
See also
mdlLinkage_extractFromElement mdlCnv_bufferFromFileFormat
StatusInt mdlLinkage_extractXDataLinkage ( byte **  ppXDataBufferOut,
UInt32 pXDataSizeOut,
MSElementP  pElementIn 
)

Extract an extended entity data (XData) linkage from element.

Parameters
[out]ppXDataBufferOutpointer to xdata buffer. Allocated by this function, must be freed by caller
[out]pXDataSizeOutbuffer size
[in]pElementInelement to extract for xdata
Returns
SUCCESS if the linkage could be extracted, else ERROR
Remarks
An XData linkage is a single unit linkage. There cannot be multiple XData linkages on an element. Therefore, the concept of an index which may be valid for other linkage types does not apply to XData. The XData linkage may contain data for more than one application that has written data to the linkage, and its contents must be parsed per registered application.
See also
mdlLinkage_deleteXDataLinkage mdlLinkage_setXDataLinkage
StatusInt mdlLinkage_getClipBoundaryLinkage ( RotMatrixP  pRMatrix,
DPoint3dP  pOrigin,
bool *  pFrontClipOn,
double *  pZFront,
bool *  pBackClipOn,
double *  pZBack,
UInt32 pNPoints,
DPoint2d *  pPoints,
UInt32  maxPoints,
MSElementCP  pElement 
)

This function is used to retrieve data from the clip boundary linkage attached to the given element.

Parameters
[out]pRMatrixthe rotation matrix
[out]pOriginthe clip boundary origin
[out]pFrontClipOnthe front clip setting, true or false
[out]pZFrontthe distance to the front clip plane
[out]pBackClipOnthe back clip setting, true or false
[out]pZBackthe distance to the back clip plane
[out]pNPointsthe number of points in the pPoints array
[out]pPointsthe array of clip boundary points
[in]maxPointsthe maximum number of points to return in pPoints
[in]pElementthe element to get the clip boundary linkage data from
Returns
SUCCESS unless the linkage data could not be retrieved, then ERROR
See also
mdlLinkage_setClipBoundaryLinkage mdlLinkage_deleteClipBoundaryLinkage
UInt16 mdlLinkage_getWords ( LinkageHeaderCP  linkHdrP)

Gets the size of the linkage, in two-byte words.

Parameters
linkHdrPIN pointer to the linkage header.
Returns
size, in words, of the linkage. MAX_ELEMENT_WORDS is returned if the linkage is too big. This result typically indicates an error in data stored in the element.
See also
usmthmdlLinkage_setWordsC ""
int mdlLinkage_setBitMask ( MSElementP  pElementIn,
UShort  linkageKey,
BitMaskCP  pBitMaskIn 
)

Sets the contents of a bit mask already appended as a linkage on an element.

Parameters
pElementInIN the element on which the bit mask is attached
linkageKeyIN the linkage key of the bit mask linkage
pBitMaskInIN the bit mask contents to set
Returns
SUCCESS if the bit mask linkage was found and could be set ""
int mdlLinkage_setBitMaskUsingDescr ( MSElementDescrH  ppElemDscrIn,
UShort  linkageKeyIn,
BitMaskCP  pBitMaskIn 
)

Sets the contents of a bit mask linkage on the given element descriptor.

Parameters
ppElemDscrInIN OUT the element descriptor the linkage is on
linkageKeyInIN the linkage key for the bit mask linkage
pBitMaskInIN the bit mask contents to set as the linkage contents
Returns
SUCCESS If the bit mask was found and set ""
StatusInt mdlLinkage_setClipBoundaryLinkage ( MSElementDescrH  ppElementDescr,
RotMatrixP  pRMatrix,
DPoint3dP  pOrigin,
bool  frontClipOn,
double  zFront,
bool  backClipOn,
double  zBack,
UInt32  nPoints,
DPoint2dP  pPoints 
)

This function is used to set clip boundary linkage containing the given settings values on the specified element.

Parameters
[in,out]ppElementDescrthe element to set the clip boundary linkage on
[in]pRMatrixthe rotation matrix to apply
[in]pOriginthe origin point
[in]frontClipOnspecifies whether the font clip is enabled
[in]zFrontspecifies the distance to the front clip plane
[in]backClipOnspecifies whether the back clip is enabled
[in]zBackspecifies the distance to the back clip plane
[in]nPointsthe number of points in the pPoints array
[in]pPointsan array of points
Returns
SUCCESS unless the append operation failed, then ERROR.
See also
mdlLinkage_deleteClipBoundaryLinkage mdlLinkage_getClipBoundaryLinkage
int mdlLinkage_setDoubleArrayLinkage ( MSElementP  pElementIn,
UShort  linkageKey,
UInt32  elementCount,
const double *  pLinkageDoubleArrayIn 
)

Sets the values in an array of doubles already set as a linkage on the specified element.

Parameters
[in]pElementInthe element on which to set the array of doubles
[in]linkageKeythe linkage key to use for the array
[in]elementCountthe number of values in the array
[in]pLinkageDoubleArrayInthe array of values to set
Returns
SUCCESS If the operation is completed without error
int mdlLinkage_setElementIDArrayLinkage ( MSElementP  elementIn,
UShort  linkageKeyIn,
UInt32  elementIDCountIn,
DgnPlatform::ElementId const *  elementIDArrayIn 
)

Sets the values in an array of elementID already set as a linkage on the specified element.

Use a dependency linkage to make persistent references to other elements, not this function!

Parameters
elementInIN the element on which to set the array of elementids
linkageKeyInIN the linkage key to use for the array
elementIDCountInIN the number of elementID values in the array
elementIDArrayInIN the array of elementIDvalues to set
Returns
SUCCESS If the operation is completed without error
Remarks
Use a dependency linkage to make persistent references to other elements! ""
See also
mdlDependency_addSimpleDependencyLinkageToDescr mdlDependency_appendLinkageUsingDescr mdlDependency_appendLinkage
int mdlLinkage_setElementIDArrayLinkageUsingDescr ( MSElementDescrH  elementDescrIO,
UShort  linkageKeyIn,
UInt32  elementIDCountIn,
DgnPlatform::ElementId const *  elementIDArrayIn 
)

Sets the values in an array of elementID already set as a linkage on the specified descriptor.

Use a dependency linkage to make persistent references to other elements, not this function!

Parameters
elementDescrIOIN the element descriptor to set the linkage array to
linkageKeyInIN the linkage key to use for the array
elementIDCountInIN the number of elementID values in the array
elementIDArrayInIN the array of elementIDvalues to set
Returns
SUCCESS If the operation is completed without error
Remarks
Use a dependency linkage to make persistent references to other elements! ""
See also
mdlDependency_addSimpleDependencyLinkageToDescr mdlDependency_appendLinkageUsingDescr mdlDependency_appendLinkage
int mdlLinkage_setStringLinkage ( MSElementP  elementIn,
UShort  linkageKey,
WCharCP  linkageStringIn 
)

This function sets the given string data linkage on the given element.

Parameters
elementInIN the element to set the linkage-string on
linkageKeyIN the linkage key to use for the string data
linkageStringInIN the linkage string to add
Remarks
If a string linkage is found on the element with the same key as specified, the new string will replace the original.
Returns
SUCCESS if the operation was completed successfully, otherwise ERROR. ""
See also
usmthmdlLinkage_appendStringLinkageC usmthmdlLinkage_setStringLinkageUsingDescrC
int mdlLinkage_setStringLinkageUsingDescr ( MSElementDescrH  ppElemDscrIn,
UShort  linkageKeyIn,
WCharCP  linkageStringIn 
)

This function sets the given string data linkage on the given element descriptor.

Parameters
ppElemDscrInIN the element descriptor to set the linkage-string on
linkageKeyInIN the linkage key to use for the string data
linkageStringInIN the linkage string to add
Remarks
If a string linkage is found on the element descriptor with the same key as specified, the new string will replace the original.
Returns
SUCCESS if the operation was completed successfully, otherwise ERROR. ""
See also
usmthmdlLinkage_appendStringLinkageC usmthmdlLinkage_setStringLinkageC
int mdlLinkage_setWords ( LinkageHeaderP  linkHdrP,
int  wordLength 
)

Sets the size of the linkage.

The maximum size of a linkage is determined by the size of the element that the linkage is to be appended to, since the total element size cannot exceed MAX_ELEMENT_WORDS, or 65535.

Parameters
linkHdrPIN pointer to the linkage header to set the size of.
wordLengthIN size of the linkage in words. If this value exceeds MAX_ELEMENT_WORDS an error is returned.
Returns
SUCCESS unless wordlength exceeds MAX_ELEMENT_WORDS , then ERROR.
See also
usmthmdlLinkage_getWordsC ""
StatusInt mdlLinkage_setXDataLinkage ( MSElementDescrH  ppElementDescrIO,
const byte pXDataBufferIn,
UInt32  xdataSizeIn 
)

Set an extended entity data (XData) linkage to element.

Parameters
[in,out]ppElementDescrIOelement on which to set xdata
[in]pXDataBufferInpointer to xdata buffer
[in]xdataSizeInbuffer size
Returns
SUCCESS if the linkage could be set, else ERROR
Remarks
An XData linkage is a single unit linkage. There cannot be multiple XData linkages on an element. Therefore, the concept of an index which may be valid for other linkage types does not apply to XData. The XData linkage may contain data for more than one application that has written data to the linkage, and its contents must be parsed per registered application.

A valid XData prerequisites presence of a registered application. If you added your data segment into the XData buffer and called this function to set the linkage to element, your data segment must start with a valid registered application ID. Format of XData can be found from a published DXF format reference.

See also
mdlLinkage_extractXDataLinkage mdlLinkage_deleteXDataLinkage

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