Classes | Functions
Shared Cell Elements

Shared Cells are an efficient way to store repeated displayable geometry. More...

Classes

struct  SharedCellHandler
 The default type handler for the SHARED_CELL_ELM type that corresponds to the SharedCell structure. More...
 
struct  SharedCellDefHandler
 The default type handler for the SHAREDCELL_DEF_ELM type that corresponds to the SharedCellDef structure. More...
 

Functions

void mdlSharedCell_addDefinitionElements (MSElementDescrP cellDscrP, RotMatrixP rotScale, Dpoint3d *rOrigin)
 Convert the cell definition element descriptor pointed to by cellDscrP to a shared cell definition and add the definition to the file. More...
 
UInt32 mdlSharedCell_addToFile (MSElementP cellHeader, RotMatrixP rMatrix, int relativeMode, int baseLevel, DgnPlatform::AssocPoint *assocOrigin)
 Add a shared cell instance to the file and display the new shared cell. More...
 
int mdlSharedCell_create (MSElementP newSCElm, MSElementCP existingSCElm, Dpoint3d *origin, RotMatrixP rMatrix, Dpoint3d *scale, WCharCP cellName, DgnPlatform::SCOverride *scOverride, int relativeMode, int baseLevel, DgnPlatform::AssocPoint *assocOrigin)
 Create a shared cell instance element from the parameters passed in. More...
 
int mdlSharedCell_deleteDefinition (const WChar *cellName)
 Delete a shared cell definition from the design file. More...
 
void mdlSharedCell_drawAllShares (WChar *cellName, int drawMode)
 Find all shared cell instances of cellName in the active model and draws these instances using the drawing mode specified by drawMode. More...
 
void mdlSharedCell_dropOneLevel (MSElementP sharedCell, UInt32 filePos, int dispFlag)
 Drop sharedCell one nesting level. More...
 
void mdlSharedCell_dropToNormalCell (MSElementP sharedCell, UInt32 filePos, int dispFlag, int freeze)
 Drop the sharing status of sharedCell and creates a new normal (or unshared) cell. More...
 
int mdlSharedCell_extract (Dpoint3d *origin, Dpoint3d *shape, RotMatrixP rMatrix, Dpoint3d *scale, DgnPlatform::SCOverride *override, WChar *cellName, int bufferSize, MSElementCP sCell, DgnModelRefP modelRef)
 Extract information from a shared cell instance element or shared cell definition element. More...
 
StatusInt mdlSharedCell_find (UInt32 *foundFilePos, DgnModelRefP *foundModelRef, const WChar *cellName, DgnModelRefP preferredModel, int allowRefs)
 Search the lists of shared cell definitions for the file position of the shared cell definition with cellName. More...
 
void mdlSharedCell_fromCellHeader (MSElementP scElem, MSElementP cellHeader, RotMatrixP rotMatrix, int relativeMode, int baseLevel, DgnPlatform::AssocPoint *assocOrigin)
 Convert a cell header to a shared cell instance element. More...
 
int mdlSharedCell_makeSureDefExists (MSElementP sharedCellElm)
 Check for a shared cell definition corresponding to the shared cell instance. More...
 
int mdlSharedCell_read (MSElementDescrH scDefPP, MSElementCP sCell, bool transformToWorld, DgnModelRefP modelRef, bool expandNested)
 Read the shared cell definition for a shared cell instance. More...
 
int mdlSharedCell_redefine (DgnFileP library, const WChar *cellName)
 Re-read the cell definition from the cell library and creates a new shared cell definition. More...
 
void mdlSharedCell_setRange (MSElementP sharedCellElm, DgnModelRefP modelRef)
 Read the shared cell definition for the shared cell and sets its range block according to that definition. More...
 
void mdlSharedCell_setRangeDiag (MSElementP sharedCellElm)
 Calculate the range diagonal of a shared cell definition element and store it on the shared cell instance element. More...
 
void mdlSharedCell_setOriginAndRange (MSElementDescrP cellDP, Dpoint3d *originP)
 Update the origin and range of a shared cell definition. More...
 
int mdlSharedCell_toNormalCell (MSElementDescrH cellDPP, MSElementP scInstanceP, DgnModelRefP modelRef)
 Create an element descriptor that is the normal (unshared) cell equivalent of a shared cell instance. More...
 
int mdlSharedCell_toNormalCell2 (MSElementDescrH cellDPP, MSElementP scInstanceP, DgnModelRefP modelRef, bool applyByCellLevelAndSymbology)
 Create an element descriptor that is the normal (unshared) cell equivalent of a shared cell instance. More...
 
DgnModelRefP mdlSharedCell_fileNumber (WChar *nameP, DgnModelRefP preferredFile)
 Get a reference to the model in which the shared cell definition element resides. More...
 
int mdlSharedCell_createDefinitionElement (MSElementP elementP, WCharCP cellName, bool pointCell)
 Create a shared cell definition element for the given cell name in the buffer provided. More...
 
int mdlSharedCell_getDefinitionId (DgnPlatform::ElementId *uniqueIdP, MSElementCP elmP)
 Get the unique ID of the definition element for a shared cell instance. More...
 
int mdlSharedCell_setDefinitionId (MSElementP sharedCellElmP, DgnPlatform::ElementId uniqueId)
 Set the unique ID of the definition element for a shared cell instance. More...
 
bool mdlSharedCell_isAnonymous (MSElementP sharedCellElmP, DgnModelRefP modelRef)
 Determine whether a shared cell is anonymous. More...
 
StatusInt mdlSharedCell_addAttributesFromDefinition (MSElementDescrH tagDscrPP, MSElementDescrP pSCDscr, DgnModelRefP modelRef, bool addToFile)
 Add the tags stored within a shared cell definition to a shared cell instance. More...
 
bool mdlSharedCell_definitionIsUsed (const WChar *cellNameP, DgnFileP fileObj)
 Check if a shared cell definition is in use by name. More...
 

Detailed Description

Shared Cells are an efficient way to store repeated displayable geometry.

A shared cell instance is a light-weight non-complex displayable element. Multiple instances can all refer to a common shared definition that holds the complete set of geometry. A shared cell instance displays its definition through the instance's transform that can apply translation, rotation, and scaling. Each instance can also override some element properties like color and level so that these properties are taken from the instance instead of using the properties of the elements in the definition.

Function Documentation

StatusInt mdlSharedCell_addAttributesFromDefinition ( MSElementDescrH  tagDscrPP,
MSElementDescrP  pSCDscr,
DgnModelRefP  modelRef,
bool  addToFile 
)

Add the tags stored within a shared cell definition to a shared cell instance.

Tags are stored within a shared cell definition, but are not displayed in the instance unless they are constant. These tags must be copied from the definition and added to the file.

Remarks
Old tags will not be overwritten and should be removed if desired prior to this call.
It is up to the caller to free the memory returned in tagDscrPP using mdlElmdscr_freeAll.
Parameters
[out]tagDscrPPA pointer to a location to put the resulting Element Descriptor describing the tags. NULL can be returned if the shared cell definition does not contain tags. This parameter may NULL if the caller does not need the tags immediately.
[in]pSCDscrThe shared cell instance element.
[in]modelRefThe model ref containing the shared cell instance.
[in]addToFileSet this to true if the tags should be written to the file. If this parameter is false, the tags will be found and copied into tagDscrPP (if it is not NULL) and it is up to the calling application to write them to the file.
Returns
Returns SUCCESS if the tagset is acquired; MDLERR_BADARG if pSCDscr is invalid; or ERROR if tag acquisition fails.
Remarks
Required Library: mdlbltin.lib
void mdlSharedCell_addDefinitionElements ( MSElementDescrP  cellDscrP,
RotMatrixP  rotScale,
Dpoint3d rOrigin 
)

Convert the cell definition element descriptor pointed to by cellDscrP to a shared cell definition and add the definition to the file.

Parameters
[in]cellDscrPcell (rotated, scaled, etc.)
[in]rotScalethe rotation and scaling matrix applied to the elements of cellDscrP when they were created.
[in]rOrigintranslation applied to cell
Remarks
This function inverts the rotation and scaling matrix. It then subtracts from the origin values from the cell origin to create the shared cell definition at the file origin with zero rotation and a scale factor of 1.0.
If nested cell definitions are in cellDscrP, this function creates a shared cell definition for each nested definition.
See also
mdlCell_getElmDscr
Remarks
Required Library: mdlbltin.lib
UInt32 mdlSharedCell_addToFile ( MSElementP  cellHeader,
RotMatrixP  rMatrix,
int  relativeMode,
int  baseLevel,
DgnPlatform::AssocPoint *  assocOrigin 
)

Add a shared cell instance to the file and display the new shared cell.

Parameters
[in]cellHeadera pointer to a shared cell definition element or a cell header element.
[in]rMatrixa pointer to a rotation matrix. If cellHeader is a unshared cell header, then rMatrix is used as the rotation matrix for the new shared cell instance. If cellHeader is a shared cell definition, the rotation matrix from the shared cell definition is used and rMatrix can be NULL.
[in]relativeModean integer which indicates whether the levels in the new shared cell instance should be determined in relative or absolute mode. In absolute mode the levels of the components of the shared cell definition are used. In relative mode, the difference between the level of the shared cell instance and baseLevel is added to the components of the shared cell definition.
[in]baseLevelan integer which specifies the base level from which component levels are calculated in relative mode.
[in]assocOriginAssociative origin for shared cell instance, or NULL.
Returns
The file position of the new shared cell instance within the file if it is successfully added to the file.
Remarks
Required Library: mdlbltin.lib
See also
mdlSharedCell_find
int mdlSharedCell_create ( MSElementP  newSCElm,
MSElementCP  existingSCElm,
Dpoint3d origin,
RotMatrixP  rMatrix,
Dpoint3d scale,
WCharCP  cellName,
DgnPlatform::SCOverride *  scOverride,
int  relativeMode,
int  baseLevel,
DgnPlatform::AssocPoint *  assocOrigin 
)

Create a shared cell instance element from the parameters passed in.

Parameters
[out]newSCElmThe new shared cell element.
[in]existingSCElmAn existing shared cell instance element. If this is not NULL, it will be used as a template for all properties and attributes.
[in]originThe origin of the shared cell instance. If origin is NULL, the (0, 0, 0) point of the current coordinate system is used.
[in]rMatrixThe rotation matrix for the shared cell instance. If rMatrix is NULL, the identity matrix is used.
[in]scalePoints to a Dpoint3d structure that contains the X, Y and Z scaling factors to be applied to the shared cell instance. If scale is NULL, a scale of 1.0 is used.
[in]cellNameThe name of the shared cell instance. If cellName is NULL, the name is taken from in.
[in]scOverrideThe override mask for the shared cell instance.
[in]relativeModeIndicates whether the shared cell levels will be relative or absolute to the levels in the shared cell definition. Set this argument to 0 to place the cell in absolute mode, set it to 1 to place the cell in relative mode.
[in]baseLevelThe level assigned to the shared cell instance element. This level is used only if relativeMode is true.
[in]assocOriginAn associative point to use for the shared cell instance origin. If assocOrigin is NULL, the origin from cellHeader is used.
Returns
SUCCESS if a shared cell element is created.
See also
mdlSharedCell_setRange
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_createDefinitionElement ( MSElementP  elementP,
WCharCP  cellName,
bool  pointCell 
)

Create a shared cell definition element for the given cell name in the buffer provided.

Parameters
[out]elementPA pointer to an MSElement where the shared cell definition should be stored.
[in]cellNameThe name of the shared cell.
[in]pointCellIndicates whether the shared cell definition is for a point cell. If this is true, the view independent attribute is set for the element and the snappable attribute is unset.
Returns
SUCCESS if the shared cell definition is successfully created.
Remarks
Required Library: mdlbltin.lib
bool mdlSharedCell_definitionIsUsed ( const WChar *  cellNameP,
DgnFileP  fileObj 
)

Check if a shared cell definition is in use by name.

Shared cell definitions may be used by shared cell instances, patterns, dimension terminators, etc.

Remarks
Note that this involves a scan of the entire file.
Parameters
[in]cellNamePThe name of the shared cell to check.
[in]fileObjThe file to check.
Returns
Returns true if the definition is used, false if it is not.
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_deleteDefinition ( const WChar *  cellName)

Delete a shared cell definition from the design file.

Parameters
[in]cellNameThe name of the shared cell definition to deleted.
Remarks
It is dangerous to delete a shared cell definition while there are still shared cell instances in the file that reference it. Doing so will cause them to be "lost" and never display again.
Returns
SUCCESS if a shared cell definition is deleted, ERROR if no shared cell definition can be found in the master file or if the file is read-only.
See also
mdlSharedCell_redefine
mdlElmdscr_undoableDelete
Remarks
Required Library: mdlbltin.lib
void mdlSharedCell_drawAllShares ( WChar *  cellName,
int  drawMode 
)

Find all shared cell instances of cellName in the active model and draws these instances using the drawing mode specified by drawMode.

Parameters
[in]cellNamename of cell
[in]drawModedrawing mode; see mdlElmdscr_display for draw modes.
Remarks
Required Library: mdlbltin.lib
void mdlSharedCell_dropOneLevel ( MSElementP  sharedCell,
UInt32  filePos,
int  dispFlag 
)

Drop sharedCell one nesting level.

In effect, replace the shared cell instance with the top level collection of elements in the cell. Any nested shared cell instances or nested complex components in the shared cell definition remain unchanged. If displayFlag is true, the new elements are drawn as they are added to the file.

Parameters
[in]sharedCellshared cell instance to drop.
[in]filePosfile position of original instance.
[in]dispFlagif true, display new cell as it is added to the file.
Remarks
This function can cause the file size to grow substantially, because it replaces one element with many.
Required Library: mdlbltin.lib
See also
mdlSharedCell_dropToNormalCell
void mdlSharedCell_dropToNormalCell ( MSElementP  sharedCell,
UInt32  filePos,
int  dispFlag,
int  freeze 
)

Drop the sharing status of sharedCell and creates a new normal (or unshared) cell.

Any nested shared cell instances in the shared cell definition are dropped. If displayFlag is true, the new elements are drawn as they are added to the file.

Parameters
[in]sharedCellShared cell instance to drop.
[in]filePosFile position of the original shared cell instance.
[in]dispFlagif true, display new cell
[in]freezefreeze rather than delete
Remarks
If freeze is true, this function marks the original shared cell instance as frozen rather than deleted. It also assigns a new graphic group number to the new elements and saves that number in the frozen element. The original shared cell instance can be retrieved later with the THAW command.
This function can cause the file size to grow substantially, because it replaces one element with many.
Required Library: mdlbltin.lib
See also
mdlSharedCell_dropOneLevel
int mdlSharedCell_extract ( Dpoint3d origin,
Dpoint3d shape,
RotMatrixP  rMatrix,
Dpoint3d scale,
DgnPlatform::SCOverride *  override,
WChar *  cellName,
int  bufferSize,
MSElementCP  sCell,
DgnModelRefP  modelRef 
)

Extract information from a shared cell instance element or shared cell definition element.

If output parameters are NULL, the function does not attempt to fill them in. All parameters are returned in the current coordinate system.

Parameters
[out]originshared cell origin.
[out]shapereturns an array of eight Dpoint3ds, which constitute a box that defines the extents of the cell. This idea can be illustrated if you were to use MicroStation's element selection tool to select a cell. MicroStation places handles on the boundary which defines the cell, and these handles correlate to the eight Dpoint3ds returned.
[out]rMatrixThe shared cell's rotation matrix.
[out]scaleA pointer to Dpoint3d that holds the cell's X, Y and Z scale factors.
[out]overrideA structure that defines the fields in the shared cell instance element. These fields override the values in the shared cell definition elements.
[out]cellNameThe shared cell's name.
[in]bufferSizeIf extracting cell's name, the number of widechars cellName can hold. This is ignored if cellName is NULL.
[in]sCellThe shared cell element.
[in]modelRefThe model that contains the shared cell (can be MASTERFILE for the master file).
Returns
SUCCESS if sharedCell is a valid MicroStation element of type SHARED_CELL_ELM. Otherwise, it returns MDLERR_BADELEMENT.
Remarks
Required Library: mdlbltin.lib
See also
mdlSharedCell_create
DgnModelRefP mdlSharedCell_fileNumber ( WChar *  nameP,
DgnModelRefP  preferredFile 
)

Get a reference to the model in which the shared cell definition element resides.

If preferredFile is not NULL, then it is checked first. Next the master file is checked, followed by all reference files. The function name harkens back to pre-V8 days, but the return value is a modelRef.

Parameters
[in]namePis the name of the cell to search for.
[in]preferredFileindicates the model in which to start the search.
Returns
A DgnModelRefP indicating the design model in which the definition element was found, or INVALID_MODELREF if the definition was not found.
See also
mdlSharedCell_find
Remarks
Required Library: mdlbltin.lib
StatusInt mdlSharedCell_find ( UInt32 foundFilePos,
DgnModelRefP *  foundModelRef,
const WChar *  cellName,
DgnModelRefP  preferredModel,
int  allowRefs 
)

Search the lists of shared cell definitions for the file position of the shared cell definition with cellName.

When the shared cell definition is located, the function sets foundFilePos and foundModelRef to the file position and model where the definition is located.

Parameters
[out]foundFilePosIf found, the file position of definition. Can be NULL.
[out]foundModelRefIf found, the modelRef of definition. Can be NULL.
[in]cellNameName of cell to search for.
[in]preferredModelThe model where the function will search first for the cell. This can be NULL. If allowRefs is true and the shared cell instance cannot be found in the preferred file, this function searches first the master file and, if allowRefs is true, all reference files.
[in]allowRefsIf true, reference files will be searched if the definition is not found in the preferred model or the master file.
Returns
SUCCESS if the definition was located and foundFilePos and foundModelRef are valid. It returns ERROR if no shared cell definition with the given name can be located.
Remarks
Required Library: mdlbltin.lib
See also
mdlSharedCell_makeSureDefExists mdlSharedCell_read
void mdlSharedCell_fromCellHeader ( MSElementP  scElem,
MSElementP  cellHeader,
RotMatrixP  rotMatrix,
int  relativeMode,
int  baseLevel,
DgnPlatform::AssocPoint *  assocOrigin 
)

Convert a cell header to a shared cell instance element.

If the provided cell is a shared cell definition element, the appropriate instance is created. If the cell is a normal cell then a shared cell instance is created referring to the shared cell definition of the same name. The program should call mdlSharedCell_addDefinitionElements or mdlSharedCell_makeSureDefExists to create the definition.

Parameters
[out]scElemThe shared cell instance element created.
[in]cellHeaderThe cell header element; either a shared cell definition or unshared cell.
[in]rotMatrixThe non-orthogonal rotation and scaling matrix applied to the shared cell definition.
[in]relativeModeIf true, levels will be assigned assigned relative to baseLevel.
[in]baseLevelLowest level for relative placement. This is ignored if relativeMode is false.
[in]assocOriginAn associative origin point, or NULL if it is not associated.
Remarks
This function assumes that the range block in the cell header element is valid. If it is not, mdlSharedCell_setRange should be called for the new shared cell instance.
Required Library: mdlbltin.lib
See also
mdlSharedCell_setRange
int mdlSharedCell_getDefinitionId ( DgnPlatform::ElementId *  uniqueIdP,
MSElementCP  elmP 
)

Get the unique ID of the definition element for a shared cell instance.

This function is useful only when dealing with anonymous shared cells, which do not have unique names. If the shared cell is not anonymous, you must use mdlSharedCell_find to find the correct definition.

Remarks
It is possible that this function will succeed on a non-anonymous shared cell if it has the correct dependency linkage. This is typical of shared cells brought in from DWG files.
Parameters
[out]uniqueIdPA pointer to an DgnPlatform::ElementId where the ID of the shared cell definition should be stored. This can be NULL to just check for existance and validity of the linkage.
[in]elmPThe shared cell definition element.
Returns
SUCCESS if the shared cell definition id is successfully found.
Remarks
Required Library: mdlbltin.lib
bool mdlSharedCell_isAnonymous ( MSElementP  sharedCellElmP,
DgnModelRefP  modelRef 
)

Determine whether a shared cell is anonymous.

Parameters
[in]sharedCellElmPThe shared cell definition element.
[in]modelRefThe model containing the shared cell definition.
Returns
true if the shared cell is anonymous.
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_makeSureDefExists ( MSElementP  sharedCellElm)

Check for a shared cell definition corresponding to the shared cell instance.

If the shared cell definition is not found, it reads and creates one based on the first instance found by calling mdlCell_findCell.

Parameters
[in]sharedCellElmA shared cell instance element.
Returns
SUCCESS if the shared cell definition already exists in the file or if one was read from the cell library and added to the file. It returns an error status if no cell with the proper cell name could be located or if the cell with the proper name could not be read.
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_read ( MSElementDescrH  scDefPP,
MSElementCP  sCell,
bool  transformToWorld,
DgnModelRefP  modelRef,
bool  expandNested 
)

Read the shared cell definition for a shared cell instance.

It allocates a new element descriptor and returns its address in scDefPP.

Parameters
[out]scDefPPShared cell definition element descriptor.
[in]sCellShared cell instance element.
[in]transformToWorldIf this parameter is true, the function transforms the elements of the shared cell definition to the origin, scale, and rotation of the shared cell instance. Otherwise, they remain at the origin of the world coordinate system with a scale factor of 1 and no rotation. Transformed geometry is returned as an unshared cell and not a shared cell definition.
[in]modelRefIndicates the model from which sCell originated. This determines the design file in which to search for the shared cell definition.
[in]expandNestedIf expandNested is true, this function expands any nested shared cell instances into unshared cells. Otherwise, it leaves them as shared cell instances in the element descriptor. You must also pass true for transformToWorld to use this option.
Returns
SUCCESS if the shared cell definition is read and scDefPP is valid.
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_redefine ( DgnFileP  library,
const WChar *  cellName 
)

Re-read the cell definition from the cell library and creates a new shared cell definition.

All instances of the cell are then redrawn with the new definition.

Parameters
[in]libraryThe library containing the cell. Typically this is gotten from mdlCell_findCell.
[in]cellNameName of cell to redefine.
Remarks
Since this function erases and redraws all instances of the shared cell, it may take a while to complete.
Returns
SUCCESS if the cell was processed properly. It returns an error if it could not read the new cell definition.
See also
mdlSharedCell_drawAllShares
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_setDefinitionId ( MSElementP  sharedCellElmP,
DgnPlatform::ElementId  uniqueId 
)

Set the unique ID of the definition element for a shared cell instance.

This function is useful when dealing with anonymous shared cells, which do not have unique names. If the shared cell is not anonymous, you must use mdlSharedCell_find to find the correct definition.

Remarks
This function should also be used on non-anonymous shared cells brought in from DWG files, which resolve the defintion by dependency rather than name..
Parameters
[in,out]sharedCellElmPThe shared cell definition element.
[in]uniqueIdThe DgnPlatform::ElementId of the shared cell definition.
Returns
SUCCESS if the shared cell definition id is successfully found.
Remarks
Required Library: mdlbltin.lib
void mdlSharedCell_setOriginAndRange ( MSElementDescrP  cellDP,
Dpoint3d originP 
)

Update the origin and range of a shared cell definition.

If originP is NULL the origin of the cell is calculated as the midpoint between the high and low range values of the cell.

Parameters
[in]cellDPA pointer the shared cell definition element.
[in]originPThe origin of the cell, or NULL.
See also
mdlSharedCell_setRangeDiag mdlSharedCell_setRange
Remarks
Required Library: mdlbltin.lib
void mdlSharedCell_setRange ( MSElementP  sharedCellElm,
DgnModelRefP  modelRef 
)

Read the shared cell definition for the shared cell and sets its range block according to that definition.

It needs the model to determine which file to search first for the definition.

Parameters
[in,out]sharedCellElmShared cell instance element.
[in]modelRefSource for shared cell.
See also
mdlSharedCell_setOriginAndRange mdlSharedCell_setRangeDiag
Remarks
Required Library: mdlbltin.lib
void mdlSharedCell_setRangeDiag ( MSElementP  sharedCellElm)

Calculate the range diagonal of a shared cell definition element and store it on the shared cell instance element.

The range diagonal is used to place handles when selecting the shared cell instance.

Parameters
[in]sharedCellElmA pointer to the shared cell definition element.
See also
mdlSharedCell_setOriginAndRange mdlSharedCell_setRange
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_toNormalCell ( MSElementDescrH  cellDPP,
MSElementP  scInstanceP,
DgnModelRefP  modelRef 
)

Create an element descriptor that is the normal (unshared) cell equivalent of a shared cell instance.

Remarks
The function returns a pointer to an element descriptor holding the shared cell in cellDPP. It is the responsibility of the caller to free the memory using mdlElmdscr_freeAll.
Parameters
[out]cellDPPThe normal (unshared) cell element descriptor.
[in]scInstancePThe shared cell instance element.
[in]modelRefThe model used to locate the shared cell definition for scInstanceP.
Returns
SUCCESS if the shared cell instance is converted to a normal cell or ERROR if the shared cell definition can not be found.
Remarks
Required Library: mdlbltin.lib
int mdlSharedCell_toNormalCell2 ( MSElementDescrH  cellDPP,
MSElementP  scInstanceP,
DgnModelRefP  modelRef,
bool  applyByCellLevelAndSymbology 
)

Create an element descriptor that is the normal (unshared) cell equivalent of a shared cell instance.

Remarks
The function returns a pointer to an element descriptor holding the shared cell in cellDPP. It is the responsibility of the caller to free the memory using mdlElmdscr_freeAll. It is identical to mdlSharedCell_toNormalCell except for the additional argument which determines whether byCell level and symbology values of the of the children should be applied from the parent.
Parameters
[out]cellDPPThe normal (unshared) cell element descriptor.
[in]scInstancePThe shared cell instance element.
[in]applyByCellLevelAndSymbologyif nonZero the children with by cell symbology and level are overriden with the parent values.
[in]modelRefThe model used to locate the shared cell definition for scInstanceP.
Returns
SUCCESS if the shared cell instance is converted to a normal cell or ERROR if the shared cell definition can not be found.
Remarks
Required Library: mdlbltin.lib

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