Find an element in one of the loaded DgnModels of a DgnPlatform::DgnFile by ID.
More...
|
StatusInt | mdlFile_checkDesignFile (bool *isThreeD, WCharCP fileName) |
| Determine whether a file is a valid DGN file, and if it is a DGN file, it's dimensionality. More...
|
|
ElementRefP | dgnFileObj_findElemByID (DgnFileP dgnFile, DgnPlatform::ElementId elementID, bool dictionaryOnly) |
|
DgnFileP | mdlDgnFileObj_getMasterFile () |
| Get the DgnFileObj for the current master file. More...
|
|
bool | mdlDgnFileObj_hasPendingChanges (DgnFileP dgnFileObj) |
| Determines if a design file has pending chages. More...
|
|
StatusInt | mdlDgnFileObj_createModel (DgnModelRefP *pNewModelRef, DgnFileP dgnFileObj, DgnModelRefP seedModelRef, WCharCP pName, WCharCP pDescr, DgnPlatform::DgnModelType *pType, bool *pIs3d) |
| Create a new model and add it to the specified file. More...
|
|
V8ToV7Hooks * | mdlDgnFileObj_setV8ToV7Hooks (V8ToV7Hooks *pHooks) |
| Register a group of user callback functions that are called by MicroStation when saving a MicroStation V8
file to the IGDS 8 file format (the file format used by versions of MicroStation prior to version 8.0). More...
|
|
StatusInt | mdlDgnFileObj_traverseRootModelRefs (ModelRefTraverseFunctionP callbackFunc, CallbackArgP callbackArg, DgnFileP dgnFileObj) |
| Traverse the models of the given file. More...
|
|
StatusInt | mdlDgnFileObj_traverseModelIndex (ModelIndexTraverseFunctionP pCallbackFunc, CallbackArgP pCallbackArg, DgnFileP dgnFileObj) |
| Traverse the models of the given file. More...
|
|
StatusInt | mdlDgnFileObj_findModelIDByName (DgnFileP dgnFileObj, DgnPlatform::ModelId *pModelID, WCharCP name) |
| Retrieve the persistent ID for a model from the model's name. More...
|
|
Find an element in one of the loaded DgnModels of a DgnPlatform::DgnFile by ID.
First looks in the dictionary model. If ID is not found in the dictionary model, and the "dictionaryOnly" flag is true, it then returns NULL. Otherwise it searches all loaded caches looking for the id.
- Parameters
-
[in] | dgnFile | file to search |
[in] | elementID | ID to find |
[in] | dictionaryOnly | if true, only search dictionary model. |
- Returns
- ElementRefP of element with elementID. If id is not found, return NULL.
typedef int(* ModelRefTraverseFunctionP)(int *pMayContinue, DgnModelRefP modelRef, bool isDefault, CallbackArgP pUserData) |
UserFunction called from mdlDgnFileObj_traverseRootModelRefs.
- Parameters
-
[out] | pMayContinue | true means keep going, false means stop now |
[in] | modelRef | modelRef |
[in] | isDefault | true if this is the default model |
[in] | pUserData | userdata or NULL |
- Returns
- non-zero return will stop traversal
ElementRefP dgnFileObj_findElemByID |
( |
DgnFileP |
dgnFile, |
|
|
DgnPlatform::ElementId |
elementID, |
|
|
bool |
dictionaryOnly |
|
) |
| |
StatusInt mdlDgnFileObj_createModel |
( |
DgnModelRefP * |
pNewModelRef, |
|
|
DgnFileP |
dgnFileObj, |
|
|
DgnModelRefP |
seedModelRef, |
|
|
WCharCP |
pName, |
|
|
WCharCP |
pDescr, |
|
|
DgnPlatform::DgnModelType * |
pType, |
|
|
bool * |
pIs3d |
|
) |
| |
Create a new model and add it to the specified file.
This function returns a working modelRef which must be freed with <a ="mdlModelRefList_free.htm">mdlModelRef_freeWorking.
- Parameters
-
[out] | pNewModelRef | is a DgnPlatform::DgnModelRef to the newly created model. This can be used in any of the mdl functions that accept a DgnModelRefP. It should be freed by calling mdlModelRef_freeWorking . |
[in] | dgnFileObj | indicates the design file to create the new model in. |
[in] | seedModelRef | indicates a seed model from which settings are copied into the new model. This argument should not be NULL. |
[in] | pName | indicates the name string to assign to the model. If this is NULL, a name is automatically assigned by MicroStation. |
[in] | pDescr | indicates the description string to assign to the model. If this is NULL, no description is assigned. |
[in] | pType | indicates the value that sets the type of the model. Possible values for the type are: DgnModelType::Sheet and DgnModelType::Normal. Setting pType to NULL will create model that has the same type as the seedModelRef. |
[in] | pIs3d | is3d (NULL to use seed) |
- Returns
- MDLERR_BADARG if the file reference is invalid; MDLERR_MODELNAMEEXISTS may be returned if the name specified in pName is not unique within the specified file; otherwise, if the model is created successfully, SUCCESS is returned.
- See also
- mdlModelRef_freeWorking
StatusInt mdlDgnFileObj_findModelIDByName |
( |
DgnFileP |
dgnFileObj, |
|
|
DgnPlatform::ModelId * |
pModelID, |
|
|
WCharCP |
name |
|
) |
| |
Retrieve the persistent ID for a model from the model's name.
- Parameters
-
[in] | dgnFileObj | the DgnFileObj of interest. |
[out] | pModelID | modelID of model |
[in] | name | name to seach for |
- Returns
- SUCCESS if the model was found.
- See also
- mdlDgnFileObj_getModelItemByID
DgnFileP mdlDgnFileObj_getMasterFile |
( |
| ) |
|
Get the DgnFileObj for the current master file.
DgnFileObj Functions
MicroStation can work with files in several formats (e.g. DGN V7, DGN V8, DWG, etc.). To deal with these varied formats, MicroStation defines an object called a DgnFileObj
that internally handles the differences between the capabilities of each format. The DgnFileObj
API provides functions to operate on external files in a consistent manner, regardless of external format.
MicroStation creates a DgnFileObj
for all files it opens, (e.g. the Master File, Reference files, or work files.)
DgnCaches are loaded from DgnFileObjs
.
- Returns
- The DgnFileP for the current master file.
bool mdlDgnFileObj_hasPendingChanges |
( |
DgnFileP |
dgnFileObj | ) |
|
Determines if a design file has pending chages.
- Parameters
-
[in] | dgnFileObj | is a reference to the design file of interest |
- Returns
- true if the design file has changes that have not been saved; false otherwise.
Register a group of user callback functions that are called by MicroStation when saving a MicroStation V8
file to the IGDS 8 file format (the file format used by versions of MicroStation prior to version 8.0).
- Parameters
-
[in] | pHooks | is a pointer to a structure of the form shown below. |
- Returns
- A pointer to the structure containing the hook information in place before the function was called.
StatusInt mdlDgnFileObj_traverseModelIndex |
( |
ModelIndexTraverseFunctionP |
pCallbackFunc, |
|
|
CallbackArgP |
pCallbackArg, |
|
|
DgnFileP |
dgnFileObj |
|
) |
| |
Traverse the models of the given file.
The callback will be called once for each model.
- Parameters
-
[in] | pCallbackFunc | func to call for each model |
[in] | pCallbackArg | argument to pass into func |
[in] | dgnFileObj | the DgnFileObj of interest. |
- Returns
- This function either returns an error, or it returns the last status returned by the callback.
StatusInt mdlDgnFileObj_traverseRootModelRefs |
( |
ModelRefTraverseFunctionP |
callbackFunc, |
|
|
CallbackArgP |
callbackArg, |
|
|
DgnFileP |
dgnFileObj |
|
) |
| |
Traverse the models of the given file.
The callback will be called once for each loaded model. To access all models, use the modelIndex functions - either mdlDgnFileObj_traverseModelIndex or use mdModelIterator_create and other mdlModelIterator_* functions.
- Parameters
-
[in] | callbackFunc | func to call for each model |
[in] | callbackArg | argument to pass into func |
[in] | dgnFileObj | the file object to traverse |
- Returns
- This function either returns an error, or it returns the last status returned by the callback.
StatusInt mdlFile_checkDesignFile |
( |
bool * |
isThreeD, |
|
|
WCharCP |
fileName |
|
) |
| |
Determine whether a file is a valid DGN file, and if it is a DGN file, it's dimensionality.
- Parameters
-
[out] | isThreeD | points to a boolean that is set to true if fileName is a three dimensional DGN file. |
[in] | fileName | the name of the file to be checked. |
- Returns
- SUCCESS if the file is a DGN file and ERROR otherwise.