Functions
ElementRefP Functions

Functions

DgnModelP elementRef_getCache (ElementRefP pElem)
 Given an ElementRefP, return the DgnModelP that holds it. More...
 
DgnFileP elementRef_getDgnFileObj (ElementRefP pElem)
 Given an ElementRefP, return the DgnFile that holds it. More...
 
UInt32 elementRef_getFilePos (ElementRefP pElem)
 Given an ElementRefP, return it's filepos. More...
 
void elementRef_getElementHeader (ElementRefP pElem, Elm_hdrP hdr)
 Given an ElementRefP, return just its header. More...
 
size_t elementRef_getElement (ElementRefP pElem, MSElementP pEl, size_t inSize)
 Given an ElementRefP, return the element data. More...
 
bool elementRef_isEOF (ElementRefP pElem)
 Test whether the given ElementRefP is the "end of file" marker. More...
 
bool elementRef_isComplexComponent (ElementRefP pElem)
 Test whether the given ElementRefP is a complex component. More...
 
bool elementRef_isDirty (ElementRefP pElem)
 Test whether the "dirty" flag on an element has been set. More...
 
bool elementRef_isDeleted (ElementRefP pElem)
 Test whether the element has been deleted. More...
 
bool elementRef_isCacheDeleted (ElementRefP pElem)
 Test whether the element is part of a DgnModel that has been deleted. More...
 
bool elementRef_isNew (ElementRefP pElem)
 Check the "new" flag on an element. More...
 
bool elementRef_isHilited (ElementRefP pElem, DgnModelRefP modelRef)
 Check the "hilite" flag on an elementRef/ModelRef combination. More...
 
DgnPlatform::ElementHiliteState elementRef_getHiliteState (ElementRefP pElem, DgnModelRefP modelRef)
 Check the "hilite" flag on an elementRef/ModelRef combination and return the current state. More...
 
bool elementRef_isInSelectionSet (ElementRefP pElem, DgnModelRefP modelRef)
 Check to determine whether an elementRef/ModelRef pair is currently in the selection set. More...
 
bool elementRef_isInDisplaySet (ElementRefP pElem, DgnModelRefP modelRef)
 Check to determine whether an elementRef/ModelRef pair is currently in the display set. More...
 
bool elementRef_isIncludedForModelRef (ElementRefP pElem, DgnModelRefP modelRef)
 Check to determine whether an elementRef is included for the given modelRef. More...
 
bool elementRef_hasDependents (ElementRefP elemRef)
 Test whether the specified element has dependents. More...
 
int elementRef_getDependents (ElementRefP baseElem, ElementRefP *pDependents, int nDependents)
 Get a list of IDs of elements dependent on the specified element. More...
 
bool elementRef_isDependent (ElementRefP pRoot, ElementRefP pDependent)
 Query if the 'dependent' element is a dependent of the 'root' element or of any of the elements on which it depends, and so on. More...
 
DependentElemRef elementRef_getFirstDependent (ElementRefP pElem)
 Given an ElementRefP, get the first element that is a dependent of this element, in the form of a DependentElemRef. More...
 
ElementRefP elementDependent_getElemRef (DependentElemRef thisDep)
 Given a DependentElemRef, get the ElementRefP for the dependent element. More...
 
DependentElemRef elementDependent_getNext (DependentElemRef thisDep)
 Given a DependentElemRef, get a DependentElemRef for the next element dependent on the same base element. More...
 
DgnPlatform::ElementId elementRef_getElemID (ElementRefP elemRef)
 Given an ElementRefP, get the ID of its element. More...
 
int elementRef_getElemType (ElementRefP elemRef)
 Given an ElementRefP, get the type of its element. More...
 
DgnPlatform::ElementRefType elementRef_getRefType (ElementRefP elemRef)
 Given an ElementRefP, get its type (e.g. More...
 
UInt32 elementRef_getElemLevel (ElementRefP elemRef)
 Given an ElementRefP, get the level of its element. More...
 
size_t elementRef_getElemSize (ElementRefP elemRef)
 Given an ElementRefP, get the size of its element, in bytes. More...
 
bool elementRef_isImmediateDependent (ElementRefP pRoot, ElementRefP pDependent)
 Query if the 'dependent' element is an immediate dependent of the 'root' element. More...
 
int elementRef_getElemArchive (ElementRefP elemRef)
 Given an ElementRefP, get the state of the archive flags. More...
 
int elementRef_getXAttributeArchive (ElementRefP elemRef)
 Check if the ElementRefP's XAttribute archive flag is ste. More...
 
int elementRef_getElemAttrOffset (ElementRefP elemRef)
 Given an ElementRefP, get the Attribute Offset for this element. More...
 
bool elementRef_isComplexHeader (ElementRefP elemRef)
 Given an ElementRefP, determine whether it is a complex header. More...
 
int elementRef_getComponentCount (ElementRefP elemRef)
 Given an ElementRefP, get the number of children of its element. More...
 
ElementRefP elementRef_getParent (ElementRefP pElem)
 Given an ElementRefP, return its parent's ElementRefP (returns NULL for non-complex elements). More...
 

Detailed Description

Function Documentation

ElementRefP elementDependent_getElemRef ( DependentElemRef  thisDep)

Given a DependentElemRef, get the ElementRefP for the dependent element.

Parameters
[in]thisDepA DependentElemRef received from a previous call to either. elementRef_getFirstDependent or elementDependent_getNext.
Returns
An ElementRefP for the dependent element.
See also
elementRef_getFirstDependent, elementDependent_getNext
DependentElemRef elementDependent_getNext ( DependentElemRef  thisDep)

Given a DependentElemRef, get a DependentElemRef for the next element dependent on the same base element.

Parameters
[in]thisDepA DependentElemRef received from a previous call to either. elementRef_getFirstDependent or elementDependent_getNext.
Returns
A DependentElemRef for the next dependent element.
See also
elementRef_getFirstDependent, elementDependent_getElemRef
DgnModelP elementRef_getCache ( ElementRefP  pElem)

Given an ElementRefP, return the DgnModelP that holds it.

Parameters
[in]pElemGet the DgnModel containing this ElementRefP.
Returns
DgnModelP, or NULL if the ElementRefP is not valid.
int elementRef_getComponentCount ( ElementRefP  elemRef)

Given an ElementRefP, get the number of children of its element.

For simple, non-complex headers, this will be 0.

Parameters
[in]elemRefThe ElementRefP for the element to test.
Returns
the number of children of this element
int elementRef_getDependents ( ElementRefP  baseElem,
ElementRefP *  pDependents,
int  nDependents 
)

Get a list of IDs of elements dependent on the specified element.

Parameters
[in]baseElemThe ElementRefP for the element that has dependents.
[out]pDependentsThe list of element IDs of dependent elements.
[in]nDependentsThe maximum number of element IDs to return in pDependents.
Returns
the number of dependencies written to output
DgnFileP elementRef_getDgnFileObj ( ElementRefP  pElem)

Given an ElementRefP, return the DgnFile that holds it.

Parameters
[in]pElemGet the DgnFile containing this ElementRefP.
Returns
A pointer to the DgnFile, or NULL if the ElementRefP is not valid.
int elementRef_getElemArchive ( ElementRefP  elemRef)

Given an ElementRefP, get the state of the archive flags.

Parameters
[in]elemRefThe ElementRefP to get the archive flags from.
Returns
the archive flags for this element
int elementRef_getElemAttrOffset ( ElementRefP  elemRef)

Given an ElementRefP, get the Attribute Offset for this element.

Parameters
[in]elemRefThe ElementRefP to get the Attribute Offset from.
Returns
the Attribute Offset for this element
size_t elementRef_getElement ( ElementRefP  pElem,
MSElementP  pEl,
size_t  inSize 
)

Given an ElementRefP, return the element data.

Parameters
[in]pElemThe ElementRefP to get the element data from.
[out]pElBuffer to receive the element.
[in]inSizeThe maximum number of bytes of data to copy.
Returns
number of bytes actually copied to output element, or 0 if ElementRefP is not valid.
void elementRef_getElementHeader ( ElementRefP  pElem,
Elm_hdrP  hdr 
)

Given an ElementRefP, return just its header.

Parameters
[in]pElemThe ElementRefP to get the header from.
[out]hdrThe header for pElem.
Returns
This function is of type void, it does not return a value.
DgnPlatform::ElementId elementRef_getElemID ( ElementRefP  elemRef)

Given an ElementRefP, get the ID of its element.

Parameters
[in]elemRefThe ElementRefP to get the ID from.
Returns
the ElementId for this element
UInt32 elementRef_getElemLevel ( ElementRefP  elemRef)

Given an ElementRefP, get the level of its element.

Parameters
[in]elemRefThe ElementRefP to get the level from.
Returns
the level for this element
size_t elementRef_getElemSize ( ElementRefP  elemRef)

Given an ElementRefP, get the size of its element, in bytes.

Parameters
[in]elemRefThe ElementRefP to get the size of.
Returns
the size for this element
int elementRef_getElemType ( ElementRefP  elemRef)

Given an ElementRefP, get the type of its element.

Parameters
[in]elemRefThe ElementRefP to get the type from.
Returns
the type for this element
UInt32 elementRef_getFilePos ( ElementRefP  pElem)

Given an ElementRefP, return it's filepos.

Parameters
[in]pElemThe ElementRefP to get the filepos of.
Returns
The filepos of the given ElementRefP, or 0 if the ElementRefP is not valid.
DependentElemRef elementRef_getFirstDependent ( ElementRefP  pElem)

Given an ElementRefP, get the first element that is a dependent of this element, in the form of a DependentElemRef.

Parameters
[in]pElemThe ElementRefP to get the first dependent from.
Returns
A DependentElemRef that specifies the first element that is a dependent of pElem.
Remarks
From an DependentElemRef, you can get the ElementRefP of the dependent by calling elementDependent_getElemRef.
You can get each successive dependent element by calling elementDependent_getNext until it returns NULL.
See also
elementDependent_getNext, elementDependent_getElemRef
DgnPlatform::ElementHiliteState elementRef_getHiliteState ( ElementRefP  pElem,
DgnModelRefP  modelRef 
)

Check the "hilite" flag on an elementRef/ModelRef combination and return the current state.

Parameters
[in]pElemThe ElementRefP for the element to test.
[in]modelRefThe DgnModelRefP to test.
Returns
ElementHiliteState for this elementRef/ModelRef.
ElementRefP elementRef_getParent ( ElementRefP  pElem)

Given an ElementRefP, return its parent's ElementRefP (returns NULL for non-complex elements).

Parameters
[in]pElemThe ElementRefP of a child element.
Returns
the ElementRefP of the element that is the parent of pElem
DgnPlatform::ElementRefType elementRef_getRefType ( ElementRefP  elemRef)

Given an ElementRefP, get its type (e.g.

cache, transient, etc.)

Parameters
[in]elemRefThe ElementRefP to get the type from.
Returns
the type for this ElementRefP
int elementRef_getXAttributeArchive ( ElementRefP  elemRef)

Check if the ElementRefP's XAttribute archive flag is ste.

Parameters
[in]elemRefThe ElementRefP to get the archive flags from.
Returns
the XAttribute archive flags for this element
bool elementRef_hasDependents ( ElementRefP  elemRef)

Test whether the specified element has dependents.

Parameters
[in]elemRefThe ElementRefP for the element to test.
Returns
true if the element has dependents, false otherwise.
bool elementRef_isCacheDeleted ( ElementRefP  pElem)

Test whether the element is part of a DgnModel that has been deleted.

Elements in a deleted DgnModel are held in the DgnModel, and their ElementRefs remain valid, until the DgnModel is closed or compressed.

Parameters
[in]pElemThe ElementRefP for the element to test.
Returns
true if cache is deleted, false otherwise.
bool elementRef_isComplexComponent ( ElementRefP  pElem)

Test whether the given ElementRefP is a complex component.

Parameters
[in]pElemThe ElementRefP to test.
Returns
true if this ElementRefP is a complex component
bool elementRef_isComplexHeader ( ElementRefP  elemRef)

Given an ElementRefP, determine whether it is a complex header.

Parameters
[in]elemRefThe ElementRefP for the element to test.
Returns
true if the element is a complex header
bool elementRef_isDeleted ( ElementRefP  pElem)

Test whether the element has been deleted.

Deleted elements are held in the DgnModel, and their ElementRefs remain valid, until the DgnModel is closed or compressed.

Parameters
[in]pElemThe ElementRefP for the element to test.
Returns
true if the "deleted" flag has been set, false otherwise.
bool elementRef_isDependent ( ElementRefP  pRoot,
ElementRefP  pDependent 
)

Query if the 'dependent' element is a dependent of the 'root' element or of any of the elements on which it depends, and so on.

Parameters
[in]pRootThe root ElementRefP that has dependents
[in]pDependentThe ElementRefP to look for among the root's dependents
Returns
true if pDependent is a dependent of pRoot; false otherwise.
Remarks
This function is not safe to call if the root is involved in a circular dependency relationship.
See also
elementRef_isImmediateDependent, elementRef_getDependents
bool elementRef_isDirty ( ElementRefP  pElem)

Test whether the "dirty" flag on an element has been set.

The dirty flag indicates that the element has been modified in some way since the last save operation and needs to be written to the disk.

Parameters
[in]pElemThe ElementRefP to test.
Returns
true if the "dirty" flag has been set, false otherwise
bool elementRef_isEOF ( ElementRefP  pElem)

Test whether the given ElementRefP is the "end of file" marker.

This is necessary for DgnModel iterators.

Parameters
[in]pElemThe ElementRefP to test.
Returns
true if this ElementRefP points to the End of File
bool elementRef_isHilited ( ElementRefP  pElem,
DgnModelRefP  modelRef 
)

Check the "hilite" flag on an elementRef/ModelRef combination.

Parameters
[in]pElemThe ElementRefP for the element to test.
[in]modelRefThe DgnModelRefP to test.
Returns
true if the "hilite" flag has been set for the elementRef/modelRef, false otherwise.
bool elementRef_isImmediateDependent ( ElementRefP  pRoot,
ElementRefP  pDependent 
)

Query if the 'dependent' element is an immediate dependent of the 'root' element.

Parameters
[in]pRootThe root ElementRefP that has dependents.
[in]pDependentThe ElementRefP to look for among the root's dependents.
Returns
true if pDependent is a dependent of pRoot; false otherwise.
Remarks
If this function returns true, then you would find pDependent in the list of elements returned by calling elementRef_getDependents (pRoot).
See also
elementRef_isDependent, elementRef_getDependents
bool elementRef_isIncludedForModelRef ( ElementRefP  pElem,
DgnModelRefP  modelRef 
)

Check to determine whether an elementRef is included for the given modelRef.

Parameters
[in]pElemThe ElementRefP for the element to test.
[in]modelRefThe DgnModelRefP to test.
Returns
true if elementRef is included for the modelRef, false otherwise.
bool elementRef_isInDisplaySet ( ElementRefP  pElem,
DgnModelRefP  modelRef 
)

Check to determine whether an elementRef/ModelRef pair is currently in the display set.

Parameters
[in]pElemThe ElementRefP for the element to test.
[in]modelRefThe DgnModelRefP to test.
Returns
true if elementRef/ModelRef is in the display set, false otherwise.
bool elementRef_isInSelectionSet ( ElementRefP  pElem,
DgnModelRefP  modelRef 
)

Check to determine whether an elementRef/ModelRef pair is currently in the selection set.

Parameters
[in]pElemThe ElementRefP for the element to test.
[in]modelRefThe DgnModelRefP to test.
Returns
true if elementRef/ModelRef is in the selection set, false otherwise.
bool elementRef_isNew ( ElementRefP  pElem)

Check the "new" flag on an element.

Parameters
[in]pElemThe ElementRefP for the element to test.
Returns
true if the "new" flag has been set, false otherwise.

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