Functions
DWGApplicationData

Functions

StatusInt mdlLinkage_getXDataGroupCode (XDataValueUnion *pValue, int *pValueType, UInt32 *pDataSize, int *pGroupCode, MSElementP pElement, UInt32 *pIndex)
 Used to extract an XData groupcode from an element. More...
 
StatusInt mdlLinkage_addXDataGroupCode (MSElementDescrH ppDescr, int groupCode, void *pData, int dataSize)
 Used to add XData groupcode to an element. More...
 
StatusInt mdlLinkage_findApplicationXData (UInt32 *pIndex, MSElementP pElement, DgnPlatform::ElementId applicationId)
 AutoCAD XData is organized by application. More...
 
StatusInt mdlRegApp_idFromName (DgnPlatform::ElementId *pId, WChar *pName, DgnFileP fileObj, bool createIfNotFound)
 
AutoCAD identifies data for applications through a table of Registered Applications

that is stored within each file. More...

 
StatusInt mdlRegApp_nameFromId (WChar *pName, DgnFileP fileObj, DgnPlatform::ElementId id)
 
Return the name of an application for a given ID by looking for

the ID within fileObj's registered application table. More...

 
StatusInt mdlDwgObjectPtr_extract (int *pDataBits, void **ppData, int *pDataSize, MSElementDescrP pDescr)
 Extract information from a "ObjectPtr" element. More...
 
StatusInt mdlDwgProxyObject_extract (int *pDataBits, int *pObjectDrawingFormat, int *pOrigDataFormat, int *pClassId, void **ppData, int *pDataSize, DgnPlatform::ElementId *pObjectIds, int *pObjectTypes, int nObjects, MSElementDescrP pDescr)
 Extract information from a "ProxyObject" element. More...
 
StatusInt mdlXRecord_extractGroupData (void **ppData, int *pDataSize, MSElementDescrP pDescr)
 Extract the group data from an "XRecord" element. More...
 
StatusInt mdlXRecord_getGroupCode (XDataValueUnion *pValue, int *pValueType, UInt32 *pDataSize, int *pGroupCode, UInt32 *pIndex, void *pGroupData, UInt32 groupDataSize)
 Extract data for a single group code from XRecord group data. More...
 
bool mdlElement_isXRecord (MSElementP pElement)
 Return true if the element represents a DWG XRecord. More...
 
bool mdlElement_isObjectPtr (MSElementP pElement)
 Return true if the element represents a DWG Object Ptr. More...
 
bool mdlElement_isProxyObject (MSElementP pElement)
 Return true if the element represents a DWG Proxy Object. More...
 
bool mdlElement_isDictionary (MSElementP pElement)
 Return true if the element represents a DWG XRecord. More...
 
StatusInt mdlDictionary_findDictionary (MSElementDescrH ppDescr, const WChar *pName, DgnModelRefP modelRef)
 Find the a Dictionary element with the specified name. More...
 
StatusInt mdlDictionary_extractEntry (DgnPlatform::ElementId *pID, WChar *pName, int nameSize, MSElementDescrCP pEntry)
 Extract the name and element ID for a dictionary entry. More...
 

Detailed Description

Function Documentation

StatusInt mdlDictionary_extractEntry ( DgnPlatform::ElementId *  pID,
WChar *  pName,
int  nameSize,
MSElementDescrCP  pEntry 
)

Extract the name and element ID for a dictionary entry.

Dictionary entries are components of a complex dictionary element.

Parameters
[out]pIDpointer to entry element ID.
[out]pNamepoint to entry name.
[in]nameSizesize in characters of name buffer.
[in]pEntrythe entry to extract.
Returns
SUCCESS if the data is successfully extracted.
See also
ustnthmdlDictionary_findDictionary
Remarks
Required Library: mdlbltin.lib
StatusInt mdlDictionary_findDictionary ( MSElementDescrH  ppDescr,
const WChar *  pName,
DgnModelRefP  modelRef 
)

Find the a Dictionary element with the specified name.

A Dictionary is a complex element with a single element for each dictionary entry. Each entry contains a name and an element ID.

Parameters
[out]ppDescrthe dictionary element descriptor. Should be freed by caller.
[in]pNamethe name of the dictionary to find.
[in]modelRefthe modelRef to search.
Returns
SUCCESS if the dictionary is successfully found.
See also
ustnthmdlDictionary_extractEntry
StatusInt mdlDwgObjectPtr_extract ( int *  pDataBits,
void **  ppData,
int *  pDataSize,
MSElementDescrP  pDescr 
)

Extract information from a "ObjectPtr" element.

These elements represent ObjectPtr entities from DWG files.

Parameters
[out]pDataBitsthe data bits value
[out]ppDatadata from the ObjectPtr - should be freed by caller.
[out]pDataSizesize of data in bytes.
[in]pDescrObjectPtr element
Returns
SUCCESS if the information is extracted successfully.
See also
ustnthmdlElement_isObjectPtr
Remarks
Required Library: mdlbltin.lib
StatusInt mdlDwgProxyObject_extract ( int *  pDataBits,
int *  pObjectDrawingFormat,
int *  pOrigDataFormat,
int *  pClassId,
void **  ppData,
int *  pDataSize,
DgnPlatform::ElementId *  pObjectIds,
int *  pObjectTypes,
int  nObjects,
MSElementDescrP  pDescr 
)

Extract information from a "ProxyObject" element.

These elements represent ProxyObject entities from DWG files.

Parameters
[out]pDataBitspoints to the data bits value
[out]pObjectDrawingFormatpoints to the object drawing format.
[out]pOrigDataFormatpoints to the original data format.
[out]pClassIdpoints to the class ID.
[out]ppDatadata from the ProxyObject - should be freed by caller.
[out]pDataSizeNOT CURRENTLY IMPLEMENTED
[out]pObjectIdsNOT CURRENTLY IMPLEMENTED
[out]pObjectTypesNOT CURRENTLY IMPLEMENTED
[in]nObjectsNOT CURRENTLY IMPLEMENTED
[in]pDescrProxyObject element
Returns
SUCCESS if the information is extracted successfully.
See also
ustnthmdlElement_isProxyObject
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isDictionary ( MSElementP  pElement)

Return true if the element represents a DWG XRecord.

Parameters
[in]pElementElement to test.
Returns
true if the element represents an XRecord.
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isObjectPtr ( MSElementP  pElement)

Return true if the element represents a DWG Object Ptr.

Parameters
[in]pElementElement to test.
Returns
true if the element represents an Object Ptr.
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isProxyObject ( MSElementP  pElement)

Return true if the element represents a DWG Proxy Object.

Parameters
[in]pElementElement to test.
Returns
true if the element represents an Proxy Object.
Remarks
Required Library: mdlbltin.lib
bool mdlElement_isXRecord ( MSElementP  pElement)

Return true if the element represents a DWG XRecord.

Parameters
[in]pElementElement to test.
Returns
true if the element represents an XRecord.
Remarks
Required Library: mdlbltin.lib
StatusInt mdlLinkage_addXDataGroupCode ( MSElementDescrH  ppDescr,
int  groupCode,
void *  pData,
int  dataSize 
)

Used to add XData groupcode to an element.

Any XData added to an element must be preceded by a group code containing the owning application's ID. Application IDs are obtained through the mdlRegApp_idFromName function where the name must uniquely identify the application. See the "xdatatest" application for an example of how to properly add XData to an element.

Parameters
[in,out]ppDescris a pointer to the element descriptor that the group code is appended to.
[in]groupCodegroup code - See the macro definitions DWGXDATA_... in msdefs.h or consult AutoCAD documentation for a complete listing of available group codes.
[in]pDatapointer to data - type of data must be appropriate for the group code.
[in]dataSizesize of data in bytes.
Returns
SUCCESS if the operation is completed successfully, ERROR otherwise.
See also
ustnthmdlRegApp_idFromName,
Remarks
Required Library: mdlbltin.lib
StatusInt mdlLinkage_findApplicationXData ( UInt32 pIndex,
MSElementP  pElement,
DgnPlatform::ElementId  applicationId 
)

AutoCAD XData is organized by application.

Any XData must be preceded by a groupcode 1001 (DWGXDATA_Application_Name) specifying application ID and that application implicitly owns of the XData until the next application ID group code. mdlLinkage_findApplicationXData is used to find the starting index for XData for the supplied applicationID on an element. This index can then be passed to mdlLinkage_getXDataGroupCode to get the application XData.

Parameters
[out]pIndexis a pointer to the index of the application XData (if found).
[in]pElementis a pointer to the element.
[in]applicationIdis the application ID. Application IDs uniquely identify applications. The ID for an application is specific to a file and may be obtained by calling mdlRegApp_idFromName with the application name.
Returns
SUCCESS if the operation is completed successfully, ERROR if the application data is not found.
See also
ustnthmdlRegApp_idFromName,
Remarks
Required Library: mdlbltin.lib
StatusInt mdlLinkage_getXDataGroupCode ( XDataValueUnion pValue,
int *  pValueType,
UInt32 pDataSize,
int *  pGroupCode,
MSElementP  pElement,
UInt32 pIndex 
)

Used to extract an XData groupcode from an element.

Parameters
[out]pValueis a pointer to XDataValueUnion to contain the group code data. If the type (from *pValueType) is either XDATAVALUE_String or XDATAVALUE_Binary then either pString or pBinaryData are allocated to the appropriate size and must be freed by the caller.
[out]pValueTypepoints to the group code type, XDATA_Int16, XDATA_Int32 etc.
[out]pDataSizepoints to the size of the data allocated.
[out]pGroupCodepoints to the group code value.
[in]pElementpoints to the element
[in,out]pIndexpoints to the index at which to extract the group code. This is updated to point to the next groupcode. This should be set initially to zero to extract all XDATA or by a call to mdlLinkage_findApplicationXData to start at the data for a particular application.
Returns
SUCCESS if the operation is completed successfully, ERROR if the linkage does not exist, or *pIndex does not point to a valid group code.
See also
ustnthmdlLinkage_findApplicationXData
Remarks
Required Library: mdlbltin.lib
StatusInt mdlRegApp_idFromName ( DgnPlatform::ElementId *  pId,
WChar *  pName,
DgnFileP  fileObj,
bool  createIfNotFound 
)

AutoCAD identifies data for applications through a table of Registered Applications

that is stored within each file.

Each application is identified by a unique name and entry within the table. The ID of the entry element is used to designate that a group of XData groupcodes or XRecord entities belong to that application. The mdlRegApp_idFromName is used to extract the application ID for an application from its name. If the application does not exist, and the createIfNotFound argument is set then the application is added to the registered application table and a new ID is generated for it.

Parameters
[out]pIdpoints to the application (if found or created).
[in]pNamepoints to the application name. This name is chosen by the application developer to uniquely identify the application.
[in]fileObjthe file containing the registered application.
[in]createIfNotFoundif true and the application is not found then a new entry is added to the registered application table and the ID for the new entry is returned.
Returns
SUCCESS if the application is found, or createIfNotFound is set and the application entry was created.
See also
ustnthmdlRegApp_nameFromID, ustnthmdlLinkage_findApplicationXData
Remarks
Required Library: mdlbltin.lib
StatusInt mdlRegApp_nameFromId ( WChar *  pName,
DgnFileP  fileObj,
DgnPlatform::ElementId  id 
)

Return the name of an application for a given ID by looking for

the ID within fileObj's registered application table.

Parameters
[out]pNamethe application name.
[in]fileObjthe file containing the registered application.
[in]idthe application ID to look for.
Returns
SUCCESS if the application is found.
See also
ustnthmdlRegApp_idFromName
Remarks
Required Library: mdlbltin.lib
StatusInt mdlXRecord_extractGroupData ( void **  ppData,
int *  pDataSize,
MSElementDescrP  pDescr 
)

Extract the group data from an "XRecord" element.

The group data consists of a series of application defined group codes.

Parameters
[out]ppDatathe xRecord group data. Should be freed by caller.
[out]pDataSizethe size of the group data.
[in]pDescrthe XRecord element.
Returns
SUCCESS if group data is successfully extracted.
See also
ustnthmdlXRecord_getGroupCode
Remarks
Required Library: mdlbltin.lib
StatusInt mdlXRecord_getGroupCode ( XDataValueUnion pValue,
int *  pValueType,
UInt32 pDataSize,
int *  pGroupCode,
UInt32 pIndex,
void *  pGroupData,
UInt32  groupDataSize 
)

Extract data for a single group code from XRecord group data.

Parameters
[out]pValueis a pointer to XDataValueUnion to contain the group code data. If the type (from *pValueType) is either XDATAVALUE_String or XDATAVALUE_Binary then either pString or pBinaryData are allocated to the appropriate size and must be freed by the caller.
[out]pValueTypepoints to the group code type, XDATA_Int16, XDATA_Int32 etc.
[out]pDataSizepoints to the size of the data allocated.
[out]pGroupCodepoints to the group code value.
[in,out]pIndexpoints to the XDATA index at which the value of group code is being read.
[in]pGroupDatathe group data (as extracted from mdlXRecord_extractGroupData)
[in]groupDataSizethe group data size.
Returns
SUCCESS if group code is successfully extracted.
See also
ustnthmdlXRecord_extractGroupData.
Remarks
Required Library: mdlbltin.lib

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