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... | |
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.
[out] | pID | pointer to entry element ID. |
[out] | pName | point to entry name. |
[in] | nameSize | size in characters of name buffer. |
[in] | pEntry | the entry to extract. |
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.
[out] | ppDescr | the dictionary element descriptor. Should be freed by caller. |
[in] | pName | the name of the dictionary to find. |
[in] | modelRef | the modelRef to search. |
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.
[out] | pDataBits | the data bits value |
[out] | ppData | data from the ObjectPtr - should be freed by caller. |
[out] | pDataSize | size of data in bytes. |
[in] | pDescr | ObjectPtr element |
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.
[out] | pDataBits | points to the data bits value |
[out] | pObjectDrawingFormat | points to the object drawing format. |
[out] | pOrigDataFormat | points to the original data format. |
[out] | pClassId | points to the class ID. |
[out] | ppData | data from the ProxyObject - should be freed by caller. |
[out] | pDataSize | NOT CURRENTLY IMPLEMENTED |
[out] | pObjectIds | NOT CURRENTLY IMPLEMENTED |
[out] | pObjectTypes | NOT CURRENTLY IMPLEMENTED |
[in] | nObjects | NOT CURRENTLY IMPLEMENTED |
[in] | pDescr | ProxyObject element |
bool mdlElement_isDictionary | ( | MSElementP | pElement | ) |
Return true if the element represents a DWG XRecord.
[in] | pElement | Element to test. |
bool mdlElement_isObjectPtr | ( | MSElementP | pElement | ) |
Return true if the element represents a DWG Object Ptr.
[in] | pElement | Element to test. |
bool mdlElement_isProxyObject | ( | MSElementP | pElement | ) |
Return true if the element represents a DWG Proxy Object.
[in] | pElement | Element to test. |
bool mdlElement_isXRecord | ( | MSElementP | pElement | ) |
Return true if the element represents a DWG XRecord.
[in] | pElement | Element to test. |
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.
[in,out] | ppDescr | is a pointer to the element descriptor that the group code is appended to. |
[in] | groupCode | group code - See the macro definitions DWGXDATA_... in msdefs.h or consult AutoCAD documentation for a complete listing of available group codes. |
[in] | pData | pointer to data - type of data must be appropriate for the group code. |
[in] | dataSize | size of data in bytes. |
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.
[out] | pIndex | is a pointer to the index of the application XData (if found). |
[in] | pElement | is a pointer to the element. |
[in] | applicationId | is 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. |
StatusInt mdlLinkage_getXDataGroupCode | ( | XDataValueUnion * | pValue, |
int * | pValueType, | ||
UInt32 * | pDataSize, | ||
int * | pGroupCode, | ||
MSElementP | pElement, | ||
UInt32 * | pIndex | ||
) |
Used to extract an XData groupcode from an element.
[out] | pValue | is 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] | pValueType | points to the group code type, XDATA_Int16, XDATA_Int32 etc. |
[out] | pDataSize | points to the size of the data allocated. |
[out] | pGroupCode | points to the group code value. |
[in] | pElement | points to the element |
[in,out] | pIndex | points 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. |
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.
[out] | pId | points to the application (if found or created). |
[in] | pName | points to the application name. This name is chosen by the application developer to uniquely identify the application. |
[in] | fileObj | the file containing the registered application. |
[in] | createIfNotFound | if 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. |
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.
[out] | pName | the application name. |
[in] | fileObj | the file containing the registered application. |
[in] | id | the application ID to look for. |
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.
[out] | ppData | the xRecord group data. Should be freed by caller. |
[out] | pDataSize | the size of the group data. |
[in] | pDescr | the XRecord element. |
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.
[out] | pValue | is 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] | pValueType | points to the group code type, XDATA_Int16, XDATA_Int32 etc. |
[out] | pDataSize | points to the size of the data allocated. |
[out] | pGroupCode | points to the group code value. |
[in,out] | pIndex | points to the XDATA index at which the value of group code is being read. |
[in] | pGroupData | the group data (as extracted from mdlXRecord_extractGroupData) |
[in] | groupDataSize | the group data size. |