Classes | Typedefs | Functions
Element Scanning

Classes

struct  ScanRange
 The scan range used for mdlScanCriteria. More...
 

Typedefs

typedef struct
Bentley::DgnPlatform::ScanRange 
ScanRange
 The scan range used for mdlScanCriteria. More...
 
typedef int(* ScanFunc_EachElement )(MSElementDescrP edP, CallbackArgP arg)
 Callback function used by mdlScan_extended. More...
 

Functions

int mdlScan_file (void *outBuff, int *returnSize, int buffSize, unsigned long *filePos)
 
mdlScan_file scans the design file according to the criteria

established in the last call to mdlScan_initialize. More...

 
void mdlScan_initScanlist (ExtScanListP scanlist)
 
The mdlScan_initScanlist function initializes a MicroStation scan

list pointed to by scanlist for subsequent calls to mdlScan_file. More...

 
int mdlScan_initialize (DgnModelRefP modelRef, ExtScanListP scanListP)
 Load a scan list to the MicroStation design file scanner for subsequent calls to mdlScan_file. More...
 
void mdlScan_noRangeCheck (ExtScanListP scanlist)
 
The MicroStation design file scanning utility mdlScan_file is used

for several purposes. More...

 
void mdlScan_setDrawnElements (ExtScanListP scanlist)
 
The MicroStation design file scanning utility mdlScan_file is used

for several purposes. More...

 
void mdlScan_singleViewClass (ExtScanListP scanlist, int viewIndex)
 
The MicroStation design file scanning utility mdlScan_file is used

for several purposes. More...

 
void mdlScan_viewRange (ExtScanListP scanlist, int view, DgnModelRefP modelRef)
 
  mdlScan_viewRange sets the range members of the scan list pointed

to by scanlist (scanlist->xlowlim, scanlist->xhighlim, scanlist->ylowlim, scanlist->yhighlim, scanlist->zlowlim, scanlist->zhighlim) to find only elements in view viewNumber and from file fileNumber. More...

 
int mdlScan_extended (void *scanBuf, int *scanSize, UInt32 *eosFilePos, ScanFunc_EachElement iteratorFunc, CallbackArgP iteratorArg)
 
mdlScan_extended provides the same functionality as the mdlScan_file

function, but also provides the ability for the application program to receive control after each element which meets the scanning criteria instead of waiting for the scanner to return the information after each call. More...

 
int mdlScanCriteria_setModel (ScanCriteriaP scP, DgnModelRefP modelRef)
 Sets the model on which the scan criteria will work. More...
 
DgnModelRefP mdlScanCriteria_getModel (ScanCriteriaP scP)
 Returns the model on which the scan criteria will work. More...
 
StatusInt mdlScanCriteria_setReferenceFile (ScanCriteriaP scP, DgnAttachmentP pRef)
 Alternative to mdlScanCriteria_setModel to set the scanned file directly from a reference file structure. More...
 
int mdlScanCriteria_setReturnType (ScanCriteriaP scP, int returnType, int oneElementOnly, int nestCells)
 
The mdlScanCriteria_setReturnType function is used to establish the type of

information that should be returned by the scan operation. More...

 
StatusInt mdlScanCriteria_setElmDscrCallback (ScanCriteriaP scP, PFScanElemDscrCallback callbackFunc, CallbackArgP callbackArg)
 Setup a per-descriptor callback function for scan results. More...
 
int mdlScanCriteria_scanAllModelsOfFile (ScanCriteriaP inScP, PFScanElemDscrCallback pCallbackFunc, CallbackArgP pCallbackArg, DgnPlatform::DgnModelSections modelSections, DgnFileP pDgnFileObj)
 Iterates through all models of a given file, scanning each in turn. More...
 
StatusInt mdlScanCriteria_setElemRefCallback (ScanCriteriaP scP, PFScanElemRefCallback callbackFunc, CallbackArgP callbackArg)
 Setup an ElementRefP callback function for scan results. More...
 
int mdlScanCriteria_setRangeTest (ScanCriteriaP scP, DgnPlatform::ScanRange *srP)
 
The mdlScanCriteria_setRangeTest function is used to set the range for the scan

operation. More...

 
int mdlScanCriteria_setAttributeTest (ScanCriteriaP scP, int entity, long occurrence, ExtendedAttrBuf *extAttrBuf)
 
The mdlScanCriteria_setAttributeTest function is used to enable or disable

various attribute tests. More...

 
int mdlScanCriteria_setPriorityTest (ScanCriteriaP scP, UInt32 minPriority, UInt32 maxPriority)
 
The mdlScanCriteria_setPriorityTest function is used to enable or disable

priority testing with min and max limits. More...

 
int mdlScanCriteria_setTimeTest (ScanCriteriaP scP, double minModTime, double maxModTime)
 
The mdlScanCriteria_setTimeTest function is used to enable or disable the

testing of modification time with minimum and maximum time limits. More...

 
int mdlScanCriteria_setElementTypeTest (ScanCriteriaP scP, UShort *typeMask, int maskSize)
 
The mdlScanCritiera_setElementTypeTest function is used to enable or disable

testing based on element type. More...

 
int mdlScanCriteria_getElementTypeMask (ScanCriteriaP scP, UShort *typeMask, int maskSize)
 
The mdlScanCriteria_getElementTypeMask function is used to retrieve the current

element type mask from the scan criteria. More...

 
int mdlScanCriteria_getElementTypeMaskSize (ScanCriteriaP scP, int *maskSize)
 Gets the size of the element type mask from the specified DgnPlatform::ScanCriteria. More...
 
int mdlScanCriteria_setDrawnElements (ScanCriteriaP scP)
 
The mdlScanCriteria_setDrawnElements function is used to limit the scan

operation to drawn elements, eliminating control elements from the scan process. More...

 
int mdlScanCriteria_setCellNameTest (ScanCriteriaP scP, WCharCP cellName)
 
The mdlScanCriteria_setCellNameTest function is used to establish the name of a

cell as the target for the scan operation. More...

 
int mdlScanCriteria_setLevelTest (ScanCriteriaP scP, BitMaskP levelBitMask, bool enableMultiLevelTest, bool freeWhenDone)
 
The mdlScanCriteria_setLevelTest function is used to set a level bit mask for the

scan operation. More...

 
BitMaskCP mdlScanCriteria_getLevelBitMask (ScanCriteriaCP scP)
 
The mdlScanCriteria_getLevelBitMask function is used to get the level bit mask

from the scan criteria. More...

 
int mdlScanCriteria_setConstLevelTest (ScanCriteriaP scP, BitMaskCP levelBitMask, bool enableMultiLevelTest)
 
The mdlScanCriteria_setConstLevelTest function is used to set a level bit mask

for the scan with a "const" bit mask. More...

 
int mdlScanCriteria_setPropertiesTest (ScanCriteriaP scP, int propertiesVal, int propertiesMask)
 
The mdlScanCriteria_setPropertiesTest function is used to enable or disable

testing by property value and mask. More...

 
int mdlScanCriteria_getProperties (ScanCriteriaP scP, int *propertiesValP, int *propertiesMaskP)
 
The mdlScanCriteria_getProperties function is used to get the properties value

and mask data from the specified scan criteria structure. More...

 
StatusInt mdlScanCriteria_setLockedTest (ScanCriteriaP scP, bool lockedTest, bool lockedValue)
 
The mdlScanCriteria_setLockedTest function is used to enable or disable testing

based on the locked status of the design file elements. More...

 
int mdlScanCriteria_setClassTest (ScanCriteriaP scP, int classMask)
 
The mdlScanCriteria_setClassTest function is used to enable or disable the

testing of element class. More...

 
int mdlScanCriteria_setClassTestFromView (ScanCriteriaP scP, int viewIndex)
 
The mdlScanCriteria_setClassTestFromView function is used to enable or disable

the test of element class derived from view flags. More...

 
int mdlScanCriteria_getClassMask (ScanCriteriaCP scP)
 The mdlScanCriteria_getClassMask function is used to get the current class mask. More...
 
int mdlScanCriteria_setGraphicGroupTest (ScanCriteriaP scP, UInt32 graphicGroup)
 
The mdlScanCriteria_setGraphicGroupTest function is used to enable or disable

scanning on graphic group. More...

 
int mdlScanCriteria_setStartFilePos (ScanCriteriaP scP, UInt32 startFilePos)
 
The mdlScanCriteria_setStartFilePos function is used to set the file position in

the design file to be scanned at which the scan operation will begin. More...

 
int mdlScanCriteria_setStopFilePos (ScanCriteriaP scP, UInt32 stopFilePos)
 
The mdlScanCriteria_setStopFilePos function is used to set the file position at

which the scan operation will stop. More...

 
int mdlScanCriteria_setSkewRangeTest (ScanCriteriaP scP, DgnPlatform::ScanRange *mainRangeP, DgnPlatform::ScanRange *skewRangeP, DPoint3dP skewVectorP)
 
The mdlScanCriteria_setSkewRangeTest function is used to set up a skew range

test for the scan operation. More...

 
int mdlScanCriteria_setExtendedRangeTest (ScanCriteriaP scP, DgnPlatform::ScanRange *srP, int rangeNum)
 
The mdlScanCriteria_setExtendedRangeTest function is used to enable or disable

one of the array of test ranges. More...

 
int mdlScanCriteria_getExtendedRangeTest (ScanCriteriaP scP, DgnPlatform::ScanRange *srP, int rangeNum)
 
The mdlScanCriteria_getExtendedRangeTest function is used to retrieve

one of the array of test ranges. More...

 
StatusInt mdlScanCriteria_setViewTest (ScanCriteriaP scanCriteriaP, int viewIndex, DgnModelRefP modelRef)
 
The mdlScanCriteria_setViewTest function is used to set the specified scan

criteria to scan for the levels, class file and model that are displayable for the specified file in the specified view based on the current display flags, displayed levels and view model. More...

 
StatusInt mdlScanCriteria_setViewTestWithTypeMask (ScanCriteriaP scanCriteriaP, int viewIndex, DgnModelRefP modelRef, UShort *typeMask, int maskSize, Int16 propmsk, Int16 propval, bool setLockedTest, Int16 noLocked)
 
Used to set the specified scan criteria to scan for the

levels, class file and model that are displayable for the specified file in the specified view based on the current display flags, displayed levels and view model. More...

 
StatusInt mdlScanCriteria_setViewRangeTest (ScanCriteriaP scanCriteriaP, int viewIndex, DgnModelRefP modelRef)
 The mdlScanCriteria_setViewRangeIndex function is used to set the scan criteria range test to contain the contents of the specified model within the given view. More...
 
StatusInt mdlScanCriteria_setViewNpcRangeTest (ScanCriteriaP scanCriteria, int viewIndex, DgnModelRefP modelRef, DRange3dCP npcRange)
 The mdlScanCriteria_setViewRangeIndex function is used to set the scan criteria range test to contain the contents of the specified model within the given view. More...
 
StatusInt mdlScanCriteria_setViewLevelTest (ScanCriteriaP scanCriteriaP, int viewIndex, DgnModelRefP modelRef)
 Set the scan criteria level test to contain the contents of the given model within a given view. More...
 
ScanCriteriaP mdlScanCriteria_createFindNextCriteria (DgnModelRefP modelRef, UInt32 filePos)
 
The mdlScanCriteria_createFindNextCriteria function is used to create a

scanCriteria returning element data, set its file to the specified file at the specified file position. More...

 
ScanCriteriaP mdlScanCriteria_createAllGGCriteria (DgnModelRefP modelRef, int ggroup)
 
The mdlScanCriteria_createAllGGCriteria function is used to create a

scanCriteria returning file position and data of the elements in the specified graphic group within the specified model. More...

 
StatusInt mdlScanCriteria_setLocateTest (ScanCriteriaP scanCriteriaP, bool setLockedTest)
 
The mdlScanCriteria_setLocateTest function is used to set the scan criteria to

scan for the types and properties that are enabled in the current locate table. More...

 
void mdlScanCriteria_setDisplaySetTest (ScanCriteriaP scanCriteriaP, bool enable)
 Description Turns on or off the test of whether a particular element is in the display set. More...
 
void mdlScanCriteria_setIncludedTest (ScanCriteriaP scanCriteriaP, bool enable)
 Turns on or off the test of whether a particular elements in included in the display for a reference. More...
 
int mdlScanCriteria_addSingleElementTypeTest (ScanCriteriaP scP, int type)
 
The mdlScanCriteria_addSingleElementTestType function is used to set the scan

to return elements of the type specified. More...

 
int mdlScanCriteria_removeSingleElementTypeTest (ScanCriteriaP scP, int typeTest)
 
The mdlScanCriteria_removeSingleElementTypeTest function is used to remove

the given element type from the mask of those returned by the scan. More...

 
int mdlScanCriteria_addSingleLevelTest (ScanCriteriaP scP, int level)
 
The mdlScanCriteria_addSingleLevelTest is used to set the scan

to return elements from the specified level. More...

 
bool mdlScanCriteria_isLevelActive (ScanCriteriaP scP, int level)
 
The mdlScanCriteria_isLevelActive function is used to determine whether the

specified level is active in the specified scan. More...

 
bool mdlScanCriteria_isClassActive (ScanCriteriaP scP, int dgnClass)
 
The mdlScanCriteria_isClassActive function is used to determine whether the

specified element class is active in the specified scan. More...

 
void mdlScanCriteria_setNestOverride (ScanCriteriaP scP, short *mask, bool operation)
 
The mdlScanCriteria_setNestOverride function is used to set or clear the scan

criteria to override nesting to return all components if override is true for type. More...

 
void mdlScanCriteria_disableBsplineComponents (ScanCriteriaP scP)
 
The mdlScanCriteria_disableBsplineComponents function is used to restrict the

specified scanCriteria so that it will not return Bspline curve or surface component elements. More...

 
void mdlScanCriteria_setModelSections (ScanCriteriaP scP, DgnPlatform::DgnModelSections modelSections)
 
The mdlScanCriteria_setModelSections function is used to set the model sections

or sections that are the target of the scan operation specified by the scan criteria. More...

 
void mdlScanCriteria_setFilterFunction (ScanCriteriaP scP, PFScanFilterFunction filterFunc, CallbackArgP filterArg, PFFilterArgFreeFunction argFreeFunc)
 
UInt32 mdlScanCriteria_getCurrentFilePos (ScanCriteriaP scP)
 
The mdlScanCriteria_getCurrentFilePos function is used to get the current file

position of the scan operation. More...

 

Detailed Description

Typedef Documentation

typedef int(* ScanFunc_EachElement)(MSElementDescrP edP, CallbackArgP arg)

Callback function used by mdlScan_extended.

Parameters
[in]edPcurrent element
[in]argarg provided by caller
See also
mdlScan_extended
Returns
This function should return either SUCCESS or ERROR. SUCCESS indicates that the scanning process can continue and ERROR causes the scanning process to be halted and a return code of BUFF_FULL to be returned to the calling application.
Remarks
Required Library: mdlbltin.lib
typedef struct Bentley::DgnPlatform::ScanRange ScanRange

The scan range used for mdlScanCriteria.

Function Documentation

int mdlScan_extended ( void *  scanBuf,
int *  scanSize,
UInt32 eosFilePos,
ScanFunc_EachElement  iteratorFunc,
CallbackArgP  iteratorArg 
)

mdlScan_extended provides the same functionality as the mdlScan_file

function, but also provides the ability for the application program to receive control after each element which meets the scanning criteria instead of waiting for the scanner to return the information after each call.

That is, the complete file can be scanned in a single call to this function.

Parameters
[out]scanBufoutput buffer
[in,out]scanSizesize of buffer, num words returned
[out]eosFilePosfile position where we stopped scanning
[in]iteratorFuncfunction called for each accepted element
[in]iteratorArgargument passed to iteratorFunc
Remarks
When the iteratorFunc argument is a NULL pointer, the accepted elements (and/or element addresses) are copied to the output buffer pointed to by scanBuffer. scanSize should be set to the size in words of scanBuffer, contains the number of words returned in scanBuffer on return. eofBlock contains the block number and eofByte contains the byte position of the next element to be scanned upon return. These values can be used to calculate the file position of the next element to be processed by using the DGN_FILEPOS (contained in msdefs.h) macro as shown below:
filePos = DGN_FILEPOS(eofBlock, eofByte);
Remarks
iteratorFunc is a pointer to a function which will be called by MicroStation for each element which meets the scanning criteria specified in the scanlist. If the value of this parameter is NULL, then element information is returned in the scanBuffer parameter. If this value is non-NULL, then the function specified is called once for each element which meets the scan criteria and no informtion is returned in scanBuffer and scanSize.
To use the iteratorFunc, make sure the ITERATEFUNC bit is set in the extendedType member of the scan list.
Returns
mdlScan_extended returns SUCCESS if the scan terminates normally. If an error occurs, mdlScan_extended returns one of the following error values:
Value Reason
10 End of file reached (END_OF_DGN).
11 scanBuffer full before end of file, (BUFF_FULL).
65 Bad file number.
66 Physical end of file encountered before MicroStation end of file mark.
67 Improper scan list.
68 Invalid element encountered.
See also
mdlScan_file
Remarks
Required Library: mdlbltin.lib
int mdlScan_file ( void *  outBuff,
int *  returnSize,
int  buffSize,
unsigned long *  filePos 
)

mdlScan_file scans the design file according to the criteria

established in the last call to mdlScan_initialize.

When the scan completes, *filepos is set to the start of the next element in the file.

Remarks
The accepted elements (and/or element addresses) are copied to the output buffer pointed to by scanBuffer. bufferSize should be set to the size in bytes of scanBuffer. MicroStation sets the integer pointed to by acceptedSize to the number of words returned in scanBuffer.
Parameters
[out]outBuffaccepted data
[out]returnSizeamount of information in scanBuffer
[in]buffSizesize of scanBuffer
[out]filePosending file position
Returns
mdlScan_file returns one of the following values:
Value Meaning
10 End of file reached, (END_OF_DGN).
11 scanBuffer full before end of file, (BUFF_FULL).
65 Bad file number.
66 Physical end of file encountered before MicroStation end of file mark.
67 Improper scan list.
68 Invalid element encountered.
The values END_OF_DGN and BUFF_FULL are encountered during normal scan operation. The other return values are returned when scan errors are encountered.
See also
mdlScan_extended mdlScan_setDrawnElements mdlScan_noRangeCheck mdlScan_singleViewClass mdlScan_initialize mdlScan_initScanlist
Remarks
Required Library: mdlbltin.lib
int mdlScan_initialize ( DgnModelRefP  modelRef,
ExtScanListP  scanListP 
)

Load a scan list to the MicroStation design file scanner for subsequent calls to mdlScan_file.

This function is obsolete and remains only for backward compatability. New devlopment should use the mdlScanCriteria_* functions.

Parameters
[in]modelRefThe model to be scanned.
[in]scanListPThe scan criteria to be used. Scanlist is a structure defined in scanner.h. It consists of members that determine elements that are returned in subsequent calls to mdlScan_file. The meanings of the members are as follows:
Member name Meaning
sllen This member defines the length of the scan list. For compatibility with the IGDS scan list, bit 12 can be set (as it must be on the VAX). The easiest way to set it properly is to call mdlScan_initScanlist before setting other scanlist members.
scantype This member sets various parameters for the scan, enabling the search criteria and controlling the type of information that the scan returns. Each bit in the scantype member enables a scan criterion or controls the information returned. The bits may be ORed to enable several criteria. The bit values are defined in scanner.h, and are named: ELEMDATA, NESTCELL, PICKCELL, PROPCLAS, GRPHGRP, MULTI, BOTH, ONEELEM, ATTRENT, ATTROCC, STOPSECT, LEVELS and ELEMTYPE. The ELEMDATA and BOTH bits control whether the scanner returns file positions, actual elements, or BOTH. When BOTH is set, both file positions and the actual elements are set regardless of the setting of ELEMDATA. When neither BOTH or ELEMDATA is set, file positions only are returned. When the ONEELEM bit is set, the scanner finds one element only and then returns BUFF_FULL(11). The effect of the other bits are discussed below.
tplval tplmsk The tplval and tplmsk members are used together to cause the scanner to return only elements of a given type or given level (or both). The scanner takes the first word of each element, ANDs it with tplmsk, and compares it to tplval. The element is accepted only if these values are equal. The scanner always performs this check; to disable the check, set tplval and tplmsk to zero.
xlowlim ylowlim zlowlim xhighlim yhighlim zhighlim These members define a cube in the design file. If the element range intersects this cube, the element is returned. Otherwise, it is rejected. For historical reasons, the range values in the scan list are stored in an unusual format (see mdlCnv_toScanFormat). The range check is always performed. To effectively disable this check, set each dimension's range using values from -2,147,483,648 (0x80000000) to +2,147,483,647 (0x7fffffff). The easiest way to set these values is to use mdlScan_noRangeCheck.
pcl.propvalpch.propmsk pcl.cell0 pch.cell1 The structure's two union members specify element properties and a cell name, depending on whether the PROPCLAS or PICKCELL bit is set. If the PROPCLAS bit is set, the scanner checks the element's properties and class. The scanner checks properties by joining pch.propmsk with the element's properties bits using the AND operator and then comparing the result with pcl.propval. If these values do not match, the element is rejected. The scanner checks the class by checking the bit corresponding to the element class in the clasmask member. If the bit is not set, the element is rejected. If the PICKCELL bit is set, the pcl.cell0 and pch.cell1 members are compared to the low and high words of the cell name stored in element types 1 and 2. If no exact match is found, the element is rejected.
grgroup This member is set to the graphic group number for which data is needed. If the GRPHGRP bit in scantype is set, elements that do not match the graphic group member are rejected.
sector offset These members generate a file position where the scan will start. Use the DGN_BLOCK and DGN_OFFSET members to convert from a file position to sector and offset.
entity occurnce These members selects elements according to the attribute data attached to them. If the ATTRENT or ATTROCC bit is set in scantype, only elements with attribute data will be returned. The entity value and/or occurrence value must match. If they do not, the elements will be rejected. These checks are only valid for DMRS type linkages and are of very limited use. They are included for compatibilty with legacy applications only.
levmask This member determines the levels of elements that will be returned. Bit 0 of levmask[0] must be set for element on level 1 to be returned. Bit 14 of levmask[3] must be set for elements on level 63 to be returned. To check for elements on level 64 (stored as level 0 in the design file), set bit 15 of levmask[3]. To enable level checking, set the LEVELS bit in scantype.
typmask This member determines the element types that will be returned. Bit 0 of typmask[0] must be set for element type 1 to be returned. Bit 14 of typemask[8] must be set for element type 127 to be returned. The MDL scan list contains eight words of type masks rather than the four words in IGDS.
stopsector This member defines the sector where the scan will stop. This member is effective only if the STOPSECT bit is set in scantype. This feature is rarely used.
extendedType Certain bits of this member enable some additional features of the scanner. These bits may be individually set by ORing together the values RETURN3D, FILEPOS, EXTATTR and ITERATEFUNC defined in scanner.h. When the RETURN3D bit is set, the elements returned from a 2D file will be returned in the 3D format. When the FILEPOS bit is set, values that would normally be returned as unsigned short sector, offset pairs are returned in a single unsigned long file position instead. When the EXTATTR bit is set, the extAttrBuf member of the scan list is used. The ITERATEFUNC member is used in conjunction with the mdlScan_extended function.
exrange This member is an array of extended range blocks that can be used if more than one range cube in the design plane is needed (as it frequently is in multi-view updates). If the MULTI bit is set in scantype and the sllen member is large enough to contain one or more extended range blocks, the scanner returns all elements that pass all other enabled criteria and meet any enabled scan ranges. The scanner steps through the extended range blocks until it passes the end of the enable ranges (as determined from sllen) or encounters a range with xlowlim set to a positive number and xhighlim set to a negative number.
extAttrBuf This member points to a structure of type ExtendedAttBuf, and provides a flexible mechanism for selecting elements based on their nongraphical attributes. The EXTATTR bit of the extendedType member must be set to enable this test. The ExtendedAttBuf structure is defined in scanner.h as:
typedef struct
{
short numWords;
Ushort extAttData[32];
The numWords member of this structure is set to the number of words in the attribute data that are to be considered at the beginning of each attribute linkage. The extAttData array specifies how the scanner is to test those numWords, which it does as follows: The first word of each attribute linkage is ANDed with extAttData[0] and the result compared with extAttData[numWords]. If the value matches, the check continues by ANDing the second word of the linkage with extAttData[1] and comparing with extAttData[numWords+1], etc. If the values for all numWords of any attribute linkage match, the element is accepted. Otherwise the element is rejected.
Remarks
The PROPCLAS and PICKCELL bits in scantype are mutually exclusive, and the BOTH bit overrides the value of the ELEMDATA bit. The effect of NESTCELL bit is as follows:
If NESTCELL is set and a complex header is rejected, all of the complex element's component elements are rejected also. Similarly, all component elements of the complex element are returned when the complex header is accepted. When only element data is being returned, the scanner is always in nest mode. When file positions are being returned (BOTH set or ELEMDATA clear) in nest mode, the scanner will return only complex header information and never any of the component elements. When file positions are being returned in unnest mode, the scanner can return elements of a complex even if the complex header is rejected. It can also reject elements that are components of a complex element, even if the complex header is accepted.
Returns
The mdlScan_initialize function returns SUCCESS if the scanner accepts the scan list. It returns BAD_FILE if the modelRef is not valid; and it returns MDLERR_BADSCANLIST if the size in scanlist->sllen is wrong.
See also
mdlScan_setDrawnElements mdlScan_noRangeCheck mdlScan_singleViewClass mdlScan_initScanlist mdlScan_file
Remarks
Required Library: mdlbltin.lib
void mdlScan_initScanlist ( ExtScanListP  scanlist)

The mdlScan_initScanlist function initializes a MicroStation scan

list pointed to by scanlist for subsequent calls to mdlScan_file.

The scan list is zeroed and the scan list length member is set to the proper size.

Parameters
[in]scanlistscan list
Returns
The mdlScan_initScanlist function is of type void and returns no value.
See also
mdlScan_setDrawnElements mdlScan_noRangeCheck mdlScan_singleViewClass mdlScan_initialize mdlScan_file
Remarks
Required Library: mdlbltin.lib
void mdlScan_noRangeCheck ( ExtScanListP  scanlist)

The MicroStation design file scanning utility mdlScan_file is used

for several purposes.

mdlScan_setDrawnElements, mdlScan_singleViewClass, mdlScan_noRangeCheck and mdlScan_viewRange ease the task of establishing scan criteria. mdlScan_noRangeCheck sets the range members of the scan list pointed to by scanlist (scanlist->xlowlim, scanlist->xhighlim, scanlist->ylowlim, scanlist->yhighlim, scanlist->zlowlim, scanlist->zhighlim) so that the scan list encompasses the entire design cube. When this scan list is used in subsequent calls to mdlScan_file, no elements are rejected based on range criteria. Since the scanner always checks element ranges, make sure you call mdlScan_noRangeCheck if you do want to accept elements regardless of their range. scanlist->yhighlim, scanlist->zlowlim, scanlist->zhighlim) to find only elements in view viewNumber and from file fileNumber.

Parameters
[in]scanlistscan list
Returns
mdlScan_setDrawnElements, mdlScan_noRangeCheck, mdlScan_singleViewClass and mdlScan_viewRange return no values.
See also
mdlScan_initScanlist mdlScan_initialize mdlScan_file mdlScan_singleViewClass mdlScan_viewRange
Remarks
Required Library: mdlbltin.lib
void mdlScan_setDrawnElements ( ExtScanListP  scanlist)

The MicroStation design file scanning utility mdlScan_file is used

for several purposes.

mdlScan_setDrawnElements, mdlScan_singleViewClass, mdlScan_noRangeCheck and mdlScan_viewRange ease the task of establishing scan criteria. mdlScan_setDrawnElements sets the type mask member scanlist->typmask so the scan list returns displayable elements when used in subsequent calls to mdlScan_file. The ELEMTYPE bit in scanlist->scantype must be set to cause the scanner to check element types.

Parameters
[in]scanlistscan list
Returns
mdlScan_setDrawnElements, mdlScan_noRangeCheck, mdlScan_singleViewClass and mdlScan_viewRange return no values.
See also
mdlScan_initScanlist mdlScan_initialize mdlScan_file mdlScan_noRangeCheck mdlScan_singleViewClass mdlScan_viewRange
Remarks
Required Library: mdlbltin.lib
void mdlScan_singleViewClass ( ExtScanListP  scanlist,
int  viewIndex 
)

The MicroStation design file scanning utility mdlScan_file is used

for several purposes.

mdlScan_setDrawnElements, mdlScan_singleViewClass, mdlScan_noRangeCheck and mdlScan_viewRange ease the task of establishing scan criteria. mdlScan_singleViewClass sets the class mask member of the scan list pointed to by scanlist (scanlist->clasmsk) so that subsequent calls to mdlScan_file return only the element classes that currently display in view viewNumber. The PROPCLAS bit in scanlist->scantype must be set to cause the scanner to check element class.

Parameters
[in]scanlistscan list
[in]viewIndexview to scan
Returns
mdlScan_setDrawnElements, mdlScan_noRangeCheck, mdlScan_singleViewClass and mdlScan_viewRange return no values.
See also
mdlScan_initScanlist mdlScan_initialize mdlScan_file
Remarks
Required Library: mdlbltin.lib
void mdlScan_viewRange ( ExtScanListP  scanlist,
int  view,
DgnModelRefP  modelRef 
)

  mdlScan_viewRange sets the range members of the scan list pointed

to by scanlist (scanlist->xlowlim, scanlist->xhighlim, scanlist->ylowlim, scanlist->yhighlim, scanlist->zlowlim, scanlist->zhighlim) to find only elements in view viewNumber and from file fileNumber.

Parameters
[in]scanlistscan list
[in]viewview to scan
[in]modelReffile to scan
Returns
mdlScan_setDrawnElements, mdlScan_noRangeCheck, mdlScan_singleViewClass and mdlScan_viewRange return no values.
See also
mdlScan_initScanlist mdlScan_initialize mdlScan_file mdlScan_setDrawnElements mdlScan_noRangeCheck mdlScan_singleViewClass
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_addSingleElementTypeTest ( ScanCriteriaP  scP,
int  type 
)

The mdlScanCriteria_addSingleElementTestType function is used to set the scan

to return elements of the type specified.

Parameters
[in]scPis the scan criteria structure.
[in]typeis the target element type to scan for.
Returns
SUCCESS
See also
mdlScanCriteria_setElementTypeTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_addSingleLevelTest ( ScanCriteriaP  scP,
int  level 
)

The mdlScanCriteria_addSingleLevelTest is used to set the scan

to return elements from the specified level.

Parameters
[in]scPis the scan criteria structure.
[in]levelis the target level to scan for.
Returns
SUCCESS
See also
mdlScanCriteria_setLevelTest
Remarks
Required Library: mdlbltin.lib
ScanCriteriaP mdlScanCriteria_createAllGGCriteria ( DgnModelRefP  modelRef,
int  ggroup 
)

The mdlScanCriteria_createAllGGCriteria function is used to create a

scanCriteria returning file position and data of the elements in the specified graphic group within the specified model.

The caller is responsible for calling mdlScanCriteria_free to free the scanCriteria after its use.

Parameters
[in]modelRefindicates the model to scan.
[in]ggroupis the graphic group number for which the scanCriteria will be set to scan.
Returns
A pointer to the new scanCriteria.
See also
mdlScanCriteria_createFindNextCriteria mdlScanCriteria_create
Remarks
Required Library: mdlbltin.lib
ScanCriteriaP mdlScanCriteria_createFindNextCriteria ( DgnModelRefP  modelRef,
UInt32  filePos 
)

The mdlScanCriteria_createFindNextCriteria function is used to create a

scanCriteria returning element data, set its file to the specified file at the specified file position.

The caller is responsible for calling mdlScanCriteria_free to free the scan criteria after use.

Parameters
[in]modelRefspecifies the model that the scanCriteria will be set to scan.
[in]filePosis the position within the file where the scan will start.
Returns
A pointer to a new scan criteria.
See also
mdlScanCriteria_create
Remarks
Required Library: mdlbltin.lib
void mdlScanCriteria_disableBsplineComponents ( ScanCriteriaP  scP)

The mdlScanCriteria_disableBsplineComponents function is used to restrict the

specified scanCriteria so that it will not return Bspline curve or surface component elements.

Parameters
[in,out]scPis the scanCriteria to set the restriction on.
Returns
This function is of type void and does not return a value.
See also
mdlScanCriteria_setElementTypeTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_getClassMask ( ScanCriteriaCP  scP)

The mdlScanCriteria_getClassMask function is used to get the current class mask.

Parameters
[in,out]scPis the scan criteria on which the current class mask is set.
Returns
SUCCESS
Remarks
Required Library: mdlbltin.lib
UInt32 mdlScanCriteria_getCurrentFilePos ( ScanCriteriaP  scP)

The mdlScanCriteria_getCurrentFilePos function is used to get the current file

position of the scan operation.

Parameters
[in]scPis the scan criteria structure.
Returns
An unsigned long value representing the file position of the scan operation.
See also
mdlScanCriteria_setStartFilePos mdlScanCriteria_setStopFilePos
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_getElementTypeMask ( ScanCriteriaP  scP,
UShort typeMask,
int  maskSize 
)

The mdlScanCriteria_getElementTypeMask function is used to retrieve the current

element type mask from the scan criteria.

Parameters
[in]scPis the scan criteria from which the element type mask is retrieved.
[out]typeMaskis the element type mask retrieved from the scan criteria.
[in]maskSizeis the size of the type mask.
Returns
SUCCESS
See also
mdlScanCriteria_setElementTypeTest mdlScanCriteria_getElementTypeMaskSize
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_getElementTypeMaskSize ( ScanCriteriaP  scP,
int *  maskSize 
)

Gets the size of the element type mask from the specified DgnPlatform::ScanCriteria.

Parameters
[in]scPpoints to the DgnPlatform::ScanCriteria
[out]maskSizepoints to the size of the type mask
Returns
SUCCESS
See also
mdlScanCriteria_getElementTypeMask
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_getExtendedRangeTest ( ScanCriteriaP  scP,
DgnPlatform::ScanRange *  srP,
int  rangeNum 
)

The mdlScanCriteria_getExtendedRangeTest function is used to retrieve

one of the array of test ranges.

Parameters
[in]scPis the scan criteria structure.
[out]srPis the range criteria for rangeNum.
[in]rangeNumis the index of this range.
Returns
SUCCESS, unless the rangeNum is invalid, then MDLERR_BAD_INDEX is returned.
See also
mdlScanCriteria_setRangeTest
Remarks
Required Library: mdlbltin.lib
BitMaskCP mdlScanCriteria_getLevelBitMask ( ScanCriteriaCP  scP)

The mdlScanCriteria_getLevelBitMask function is used to get the level bit mask

from the scan criteria.

Parameters
[in]scPis the scan criteria to get the level bit mask from.
Returns
The level bit mask.
See also
mdlScanCriteria_getClassMask
Remarks
Required Library: mdlbltin.lib
DgnModelRefP mdlScanCriteria_getModel ( ScanCriteriaP  scP)

Returns the model on which the scan criteria will work.

Parameters
[in]scPpoints to the DgnPlatform::ScanCriteria to get the model from
Returns
SUCCESS unless the pointer was invalid.
See also
mdlScanCriteria_setModel
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_getProperties ( ScanCriteriaP  scP,
int *  propertiesValP,
int *  propertiesMaskP 
)

The mdlScanCriteria_getProperties function is used to get the properties value

and mask data from the specified scan criteria structure.

Parameters
[in]scPis the scan criteria structure.
[out]propertiesValPis the properties value.
[out]propertiesMaskPis the properties mask.
Returns
SUCCESS
See also
mdlScanCriteria_setPropertiesTest
Remarks
Required Library: mdlbltin.lib
bool mdlScanCriteria_isClassActive ( ScanCriteriaP  scP,
int  dgnClass 
)

The mdlScanCriteria_isClassActive function is used to determine whether the

specified element class is active in the specified scan.

Parameters
[in]scPis the scan criteria structure.
[in]dgnClassis the element class to test.
Returns
false if the specified class is not active in the scan, true if the class is active in the scan.
See also
mdlScanCriteria_setClassTest
Remarks
Required Library: mdlbltin.lib
bool mdlScanCriteria_isLevelActive ( ScanCriteriaP  scP,
int  level 
)

The mdlScanCriteria_isLevelActive function is used to determine whether the

specified level is active in the specified scan.

Parameters
[in]scPis the scan criteria structure.
[in]levelis the level to test.
Returns
false if the specified level is not active in the scan, true if the level is active in the scan.
See also
mdlScanCriteria_setLevelTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_removeSingleElementTypeTest ( ScanCriteriaP  scP,
int  typeTest 
)

The mdlScanCriteria_removeSingleElementTypeTest function is used to remove

the given element type from the mask of those returned by the scan.

Parameters
[in]scPis the scan criteria structure.
[in]typeTestis the element type to remove.
Returns
SUCCESS
See also
mdlScanCriteria_addSingleElementTypeTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_scanAllModelsOfFile ( ScanCriteriaP  inScP,
PFScanElemDscrCallback  pCallbackFunc,
CallbackArgP  pCallbackArg,
DgnPlatform::DgnModelSections  modelSections,
DgnFileP  pDgnFileObj 
)

Iterates through all models of a given file, scanning each in turn.

The scan criteria tests are applied, including element category. The dictionary model elements are scanned only once as part of the first model. Only scan criteria with iterate return types are acceptable. The callback function can return SCANALL_ABORT_SCAN to abort the entire scan, or SCANALL_ABORT_CURRENT_MODEL to abort the scan of the current model. SUCCESS should be returned to continue scanning. Note that this function will load all models in the file, and as such should be avoided. Usually only visible elements are needed, so scanning the active model ref or loaded model refs using mdlDgnFileObj_traverseRootModelRefs is prefereable.

Returns
SUCCESS if the operation is completed successfully.
Parameters
[in,out]inScPscan criteria and context
[in]pCallbackFuncfunction to call for each element
[in]pCallbackArgarg to callbackFunc
[in]modelSectionsmask using DGNMODEL_SECTION_xxx
[in]pDgnFileObjfile to scan
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setAttributeTest ( ScanCriteriaP  scP,
int  entity,
long  occurrence,
ExtendedAttrBuf extAttrBuf 
)

The mdlScanCriteria_setAttributeTest function is used to enable or disable

various attribute tests.

Parameters
[in]scPis the scan criteria structure.
[in]entityis the entity test value. If this is 0, the entity text is disabled.
[in]occurrenceis the occurrence test value. If this is 0, no occurrence test is performed.
[in]extAttrBufis a pointer to a structure of type ExtendedAttBuf, and provides a flexible mechanism for selecting elements based on their nongraphical attributes. The ExtendedAttBuf structure is defined as:
{
short numWords;
Ushort extAttData[32];
} ;
The numWords member of this structure is set to the number of words in the attribute data that are to be considered at the beginning of each attribute linkage. The extAttData array specifies how the scanner is to test those numWords, which it does as follows: The first word of each attribute linkage is ANDed with extAttData[0] and the result compared with extAttData[numWords]. If the value matches, the check continues by ANDing the second word of the linkage with extAttData[1] and comparing with extAttData[numWords+1], etc. If the values for all numWords of any attribute linkage match, the element is accepted. Otherwise the element is rejected. If this argument is NULL, no extended attribute testing is done.
Remarks
It is possible for the extended attribute selection to work with buffers larger than the 32 words defined in the ExtendedAttrBuf structure. You can define your own structure that start with a short defining the number of words to be considered, followed by an array of Ushort's as described above. The algorithm as described above then simply works on the larger buffer.
Returns
SUCCESS
See also
mdlScanCriteria_setPropertiesTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setCellNameTest ( ScanCriteriaP  scP,
WCharCP  cellName 
)

The mdlScanCriteria_setCellNameTest function is used to establish the name of a

cell as the target for the scan operation.

Parameters
[in]scPis the scan criteria structure.
[in]cellNameis the name of the cell to set as the scan target.
Returns
SUCCESS
See also
mdlScanCriteria_setDrawnElements
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setClassTest ( ScanCriteriaP  scP,
int  classMask 
)

The mdlScanCriteria_setClassTest function is used to enable or disable the

testing of element class.

If the classMask argument is set to 0, then class testing is disabled.

Parameters
[in]scPis the scan criteria structure on which element class testing is enabled or disabled.
[in]classMaskis the mask of target classes. This is formed as an OR of the desired classes, using (1 << class) for the desired classes from the DgnElementClass enum.
Returns
SUCCESS
See also
mdlScanCriteria_setPropertiesTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setClassTestFromView ( ScanCriteriaP  scP,
int  viewIndex 
)

The mdlScanCriteria_setClassTestFromView function is used to enable or disable

the test of element class derived from view flags.

Parameters
[in]scPis the scan criteria to set the class test on.
[in]viewIndexindicates the view from which to derive the class mask.
Returns
SUCCESS
See also
mdlScanCriteria_setClassTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setConstLevelTest ( ScanCriteriaP  scP,
BitMaskCP  levelBitMask,
bool  enableMultiLevelTest 
)

The mdlScanCriteria_setConstLevelTest function is used to set a level bit mask

for the scan with a "const" bit mask.

In this case the level bit mask is never freed when the scan criteria is freed by calling mdlScanCriteria_free.

Parameters
[in]scPis the scan criteria on which the level bit mask is set.
[in]levelBitMaskis the bit mask of acceptable levels.
[in]enableMultiLevelTestis for a future capability and should always be set to false.
Returns
SUCCESS
See also
mdlScanCriteria_setLevelTest
Remarks
Required Library: mdlbltin.lib
void mdlScanCriteria_setDisplaySetTest ( ScanCriteriaP  scanCriteriaP,
bool  enable 
)

Description Turns on or off the test of whether a particular element is in the display set.

Parameters
[in,out]scanCriteriaPis a pointer to the scan criteria to set display set testing for.
[in]enableIf true, only elements in the display set for the scan criteria's modelRef are returned by the scan. If false, elements are returned without regard to whether they are in the display set or not.
See also
mdlScanCritiera_setViewTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setDrawnElements ( ScanCriteriaP  scP)

The mdlScanCriteria_setDrawnElements function is used to limit the scan

operation to drawn elements, eliminating control elements from the scan process.

Parameters
[in]scPis the scan critiera structure.
Returns
SUCCESS
See also
mdlScanCriteria_setElementTypeTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setElementTypeTest ( ScanCriteriaP  scP,
UShort typeMask,
int  maskSize 
)

The mdlScanCritiera_setElementTypeTest function is used to enable or disable

testing based on element type.

Parameters
[in]scPis the scan criteria structure on which the typeMask is set.
[in]typeMaskis the element type bit mask. If this argument is NULL then all element types are scanned.
[in]maskSizesets the size of the bit mask.
Returns
SUCCESS
See also
mdlScanCriteria_setDrawnElements
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setElemRefCallback ( ScanCriteriaP  scP,
PFScanElemRefCallback  callbackFunc,
CallbackArgP  callbackArg 
)

Setup an ElementRefP callback function for scan results.

Parameters
[in]scPpoints to the DgnPlatform::ScanCriteria to set the callback function for
[in]callbackFuncfunction pointer, called with parameter list callBackFunc (ElementRefP, void *callbackArg, ScanCriteriaP scP)
[in]callbackArgcaller's context data.
Returns
SUCCESS if the operation is completed successfully.
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setElmDscrCallback ( ScanCriteriaP  scP,
PFScanElemDscrCallback  callbackFunc,
CallbackArgP  callbackArg 
)

Setup a per-descriptor callback function for scan results.

The callback function is called once for each element descriptor that is accepted by the scan. The callback function should return SUCCESS to continue the scan or any other value to terminate the scan. If the scan is terminated by the callback function, the return code from mdlScanCriteria_scan is BUFF_FULL. The element descriptor that is passed to the callback function should not be modified or freed by the callback function. The callback function can duplicate the element descriptor, modify the duplicate, and then rewrite it to the file, if desired. The duplicate should then be freed, of course. If the callback function does modify and rewrite element descriptors, and the element descriptor might change size as a result of the modification, the programmer should take measures to make sure that the program doesn't later process that same element descriptor again, modifying it again and thus causing an infinite loop. The best way to do that is to make the scanner stop at the original EOF by using mdlScanCriteria_setStopFilePos.

Parameters
[in]scPpoints to the DgnPlatform::ScanCriteria to set the callback function for
[in]callbackFuncfunction pointer, called with parameter list callBackFunc (edP, callbackArg, DgnPlatform::ScanCriteria *scP)
[in]callbackArgcaller's context data.
Returns
SUCCESS if the operation is completed successfully.
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setExtendedRangeTest ( ScanCriteriaP  scP,
DgnPlatform::ScanRange *  srP,
int  rangeNum 
)

The mdlScanCriteria_setExtendedRangeTest function is used to enable or disable

one of the array of test ranges.

Parameters
[in]scPis the scan criteria structure.
[in]srPis the range criteria.
[in]rangeNumis the index of this range.
Returns
SUCCESS, unless the rangeNum is invalid, then MDLERR_BAD_INDEX is returned.
See also
mdlScanCriteria_setRangeTest
Remarks
Required Library: mdlbltin.lib
void mdlScanCriteria_setFilterFunction ( ScanCriteriaP  scP,
PFScanFilterFunction  filterFunc,
CallbackArgP  filterArg,
PFFilterArgFreeFunction  argFreeFunc 
)
Parameters
[in,out]scPscan criteria for which filter function is set
[in]filterFuncfilter function
[in]filterArgargument to f ilter function
[in]argFreeFuncfunction to free filterArg when mdlScanCriteria_free is called
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setGraphicGroupTest ( ScanCriteriaP  scP,
UInt32  graphicGroup 
)

The mdlScanCriteria_setGraphicGroupTest function is used to enable or disable

scanning on graphic group.

If the graphicGroup argument is 0, the graphic group testing is disabled. If it is enabled, only elements with the given graphic group are returned.

Parameters
[in]scPis the scan criteria structure on which graphic group testing is enabled or disabled.
[in]graphicGroupis the target graphic group number to scan for.
Returns
SUCCESS
See also
mdlScanCriteria_setLockedTest
Remarks
Required Library: mdlbltin.lib
void mdlScanCriteria_setIncludedTest ( ScanCriteriaP  scanCriteriaP,
bool  enable 
)

Turns on or off the test of whether a particular elements in included in the display for a reference.

Parameters
[in,out]scanCriteriaPis a pointer to the scan criteria to set reference include testing for.
[in]enableIf true, only elements in the included set for the scan criteria's modelRef are returned by the scan. If false, elements are returned without regard to whether they are in the included set or not.
Remarks
When a reference is attached with a named group, only the elements in that named group are displayed, located, or snapped. When such a reference is loaded, the status of whether a particular element is displayed for the attachment is stored in the elementRef. When the IncludedTest is turned on, the scanner passes only elements that are included.
See also
mdlScanCritiera_setViewTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setLevelTest ( ScanCriteriaP  scP,
BitMaskP  levelBitMask,
bool  enableMultiLevelTest,
bool  freeWhenDone 
)

The mdlScanCriteria_setLevelTest function is used to set a level bit mask for the

scan operation.

Optionally, the bitmask used to indicate the acceptable levels can be freed when the operation is complete.

Parameters
[in]scPis the scan criteria structure.
[in]levelBitMaskis the bitmask indicating the acceptable levels.
[in]enableMultiLevelTestis for a future capability and should always be set to false for V8.
[in]freeWhenDonedetermines whether the bitmask is freed when the scan criteria is freed.
Returns
SUCCESS
See also
mdlScanCriteria_setPropertiesTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setLocateTest ( ScanCriteriaP  scanCriteriaP,
bool  setLockedTest 
)

The mdlScanCriteria_setLocateTest function is used to set the scan criteria to

scan for the types and properties that are enabled in the current locate table.

This should be used in conjunction with mdlScanCritiera_setViewTest to set up location within a view. No range testing is enabled.

Parameters
[in,out]scanCriteriaPis a pointer to the scan criteria to set up to use the locate table types and properties for scanning.
[in]setLockedTestdetermines whether locked elements will be eliminated during the scan. If this value is set to true and tcb->noLocked is also true, then locked elements will be filtered out.
Returns
SUCCESS
See also
mdlScanCritiera_setViewTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setLockedTest ( ScanCriteriaP  scP,
bool  lockedTest,
bool  lockedValue 
)

The mdlScanCriteria_setLockedTest function is used to enable or disable testing

based on the locked status of the design file elements.

Parameters
[in]scPis the scan criteria structure on which the locked status testing is enabled or disabled.
[in]lockedTestdetermines whether the locked status testing is enabled (true) or disabled (false).
[in]lockedValueis the target locked flag value to scan for, either true or false.
Returns
SUCCESS
See also
mdlScanCriteria_setPropertiesTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setModel ( ScanCriteriaP  scP,
DgnModelRefP  modelRef 
)

Sets the model on which the scan criteria will work.

This resets the starting and ending file position, and sets the scan criteria to return all element categories.

Parameters
[in]scPpoints to the DgnPlatform::ScanCriteria to set the model for
[in]modelRefindicates the model to be scanned.
Returns
SUCCESS unless the modelRef was invalid.
See also
mdlScanCriteria_getModel
Remarks
Required Library: mdlbltin.lib
void mdlScanCriteria_setModelSections ( ScanCriteriaP  scP,
DgnPlatform::DgnModelSections  modelSections 
)

The mdlScanCriteria_setModelSections function is used to set the model sections

or sections that are the target of the scan operation specified by the scan criteria.

Before this function is called, call mdlScanCriteria_setModel.

Parameters
[in,out]scPis the scan criteria on which the element category is being set.
[in]modelSectionsindicates the target sections for the scan. Valid values for the sections are OR'ed combinations of the DgnModelSections enum, except the combination DgnModelSections::Dictionary | DgnModelSections::GraphicElements is invalid. If mdlScanCriteria_setModelSections is not called, all model sections are scanned.
Returns
This function is of type void and does not return a value.
See also
mdlScanCriteria_setModel mdlScanCriteria_setElementTypeTest
Remarks
Required Library: mdlbltin.lib
void mdlScanCriteria_setNestOverride ( ScanCriteriaP  scP,
short *  mask,
bool  operation 
)

The mdlScanCriteria_setNestOverride function is used to set or clear the scan

criteria to override nesting to return all components if override is true for type.

Parameters
[in,out]scPis the scan criteria structure.
[in]maskis the mask that determines which element types are set and which are not.
[in]operationdetermines whether the mask is used to set or clear the nest override in the scan criteria structure.
Returns
This function is of type void and does not return a value.
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setPriorityTest ( ScanCriteriaP  scP,
UInt32  minPriority,
UInt32  maxPriority 
)

The mdlScanCriteria_setPriorityTest function is used to enable or disable

priority testing with min and max limits.

If maxPriority is less than minPriority, then priority testing is disabled.

Parameters
[in]scPis the scan criteria structure.
[in]minPriorityis the minimum priority value.
[in]maxPriorityis the maximum priority value.
Returns
SUCCESS
See also
mdlScanCriteria_setAttributeTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setPropertiesTest ( ScanCriteriaP  scP,
int  propertiesVal,
int  propertiesMask 
)

The mdlScanCriteria_setPropertiesTest function is used to enable or disable

testing by property value and mask.

If the propertiesVal argument is set to 0, then properties testing is disabled.

Parameters
[in]scPis the scan criteria structure on which property testing is enabled or disabled.
[in]propertiesValis the value part of the properties test.
[in]propertiesMaskis the mask part of the properties test.
Remarks
The scanner checks the element's properties by ANDing propertiesMask with the element's properties bits and then comparing the result with propertiesVal. If these values do not match, the element is rejected.
Returns
SUCCESS
See also
mdlScanCriteria_setLockedTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setRangeTest ( ScanCriteriaP  scP,
DgnPlatform::ScanRange *  srP 
)

The mdlScanCriteria_setRangeTest function is used to set the range for the scan

operation.

Multiple ranges can be set using the mdlScanCriteria_setExtendedRangeTest function. The general range is index 0 of the array altered by the extended function.

Parameters
[in]scPis the scan criteria structure on which the range is to be set.
[in]srPis the scan range. If NULL, and no extended ranges have been set, range testing is disabled.
Returns
SUCCESS
See also
mdlScanCriteria_setExtendedRangeTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setReferenceFile ( ScanCriteriaP  scP,
DgnAttachmentP  pRef 
)

Alternative to mdlScanCriteria_setModel to set the scanned file directly from a reference file structure.

Parameters
[in]scPpoints to the DgnPlatform::ScanCriteria to set the scanned file on
[in]pRefpoints to the DgnPlatform::DgnAttachment structure to set the scanned file from
Returns
MDLERR_BADARG if pRef is not valid, otherwise SUCCESS.
See also
mdlScanCriteria_setModel
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setReturnType ( ScanCriteriaP  scP,
int  returnType,
int  oneElementOnly,
int  nestCells 
)

The mdlScanCriteria_setReturnType function is used to establish the type of

information that should be returned by the scan operation.

Parameters
[in]scPis the scan criteria structure containing the information about the scan operation.
[in]returnTypeis one of the return type selectors. Valid values for this argument are: MSSCANCRIT_RETURN_FILEPOS MSSCANCRIT_RETURN_ELEMENTDATA MSSCANCRIT_RETURN_POSANDDATA MSSCANCRIT_RETURN_UNIQUEID MSSCANCRIT_ITERATE_ELMDSCR MSSCANCRIT_ITERATE_ELMREF
[in]oneElementOnlyindicates whether the scan operation should stop after a single element is found that matches the scan criteria.
[in]nestCellsenables/disables the return of complex elements (e.g. nested cells) that contain elements matching the scan criteria. Set this to false to disable the return of complete complex elements, set it to true to enable this feature.
Remarks
If nestCells is set and a complex header is rejected, all of the complex element's component elements are rejected also. Similarly, all component elements of the complex element are returned when the complex header is accepted. If the returnType is set to MSSCANCRIT_RETURN_ELEMENTDATA or MSSCANCRIT_ITERATE_xxx, than the scan always operates with nestCells set to true. When file positions or uniqueIDs are returned with nestCells true, the scan will return only complex header information and never any of the component elements. When file positions or uniqueIDs are returned with nestCells false, the scan can return component elements of a complex even if the complex header is rejected. It can also reject component elements of a complex element, even if the complex header is accepted. If returnType is MSSCANCRIT_ITERATE_ELMDSCR, set the iterator function using mdlScanCriteria_setElmDscrCallback. If returnType is MSSCANCRIT_ITERATE_ELMRef, set the iterator function using mdlScanCriteria_setElemRefCallback.
Returns
SUCCESS if the operation is completed successfully.
See also
mdlScanCriteria_setModel
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setSkewRangeTest ( ScanCriteriaP  scP,
DgnPlatform::ScanRange *  mainRangeP,
DgnPlatform::ScanRange *  skewRangeP,
DPoint3dP  skewVectorP 
)

The mdlScanCriteria_setSkewRangeTest function is used to set up a skew range

test for the scan operation.

Parameters
[in]scPis the scan criteria structure on which the skew range is set.
[in]mainRangePis the main range.
[in]skewRangePis the skew range.
[in]skewVectorPis the skew vector to be applied.
Returns
SUCCESS
See also
mdlScanCriteria_setRangeTest
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setStartFilePos ( ScanCriteriaP  scP,
UInt32  startFilePos 
)

The mdlScanCriteria_setStartFilePos function is used to set the file position in

the design file to be scanned at which the scan operation will begin.

Parameters
[in]scPis the scan criteria structure on which the start file position is being set.
[in]startFilePosis the file position in the target design file at which the scan operation will begin.
Remarks
The mdlScanCriteria_setStartFilePos function is mutually exclusive with the mdlScanCriteria_setModelSections function.
Returns
SUCCESS
See also
mdlScanCriteria_setStopFilePos
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setStopFilePos ( ScanCriteriaP  scP,
UInt32  stopFilePos 
)

The mdlScanCriteria_setStopFilePos function is used to set the file position at

which the scan operation will stop.

Parameters
[in]scPis the scan criteria structure on which the stop file position is being set.
[in]stopFilePosis the file position at which the scan operation will stop.
Returns
SUCCESS
Remarks
The mdlScanCriteria_setStopFilePos function is mutually exclusive with the mdlScanCriteria_setModelSections function.
When writing elements to the file, this should be set to avoid an infinite loop. Use mdlModelRef_getEof to acquire the current end of file position.
See also
mdlScanCriteria_setStartFilePos
Remarks
Required Library: mdlbltin.lib
int mdlScanCriteria_setTimeTest ( ScanCriteriaP  scP,
double  minModTime,
double  maxModTime 
)

The mdlScanCriteria_setTimeTest function is used to enable or disable the

testing of modification time with minimum and maximum time limits.

If maxModTime is less than minModTime then modification time testing is disabled.

Parameters
[in]scPis the scan critiera structure on which the modification time testing is enabled or disabled.
[in]minModTimeis the lower limit value of the time test range.
[in]maxModTimeis the upper limit value of the time test range.
Returns
SUCCESS
See also
mdlScanCriteria_setElementTypeTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setViewLevelTest ( ScanCriteriaP  scanCriteriaP,
int  viewIndex,
DgnModelRefP  modelRef 
)

Set the scan criteria level test to contain the contents of the given model within a given view.

No other criteria are set.

Parameters
[in,out]scanCriteriaPpoints to the DgnPlatform::ScanCriteria to set the level test on.
[in]viewIndexthe index of the view to copy the levelDisplayMask from
[in]modelRefthe modelRef for which the levelDisplayMask is found on the view.
Remarks
The levelDisplayMask is copied from the specified view and used to set the level test for the given DgnPlatform::ScanCriteria.
Returns
SUCCESS unless the viewIndex or modelRef is invalid.
Remarks
Required Library: mdlbltin.lib
See also
mdlScanCriteria_setViewRangeTest
StatusInt mdlScanCriteria_setViewNpcRangeTest ( ScanCriteriaP  scanCriteria,
int  viewIndex,
DgnModelRefP  modelRef,
DRange3dCP  npcRange 
)

The mdlScanCriteria_setViewRangeIndex function is used to set the scan criteria range test to contain the contents of the specified model within the given view.

No other criteria are set.

Parameters
[in,out]scanCriteriais the scan criteria to modify.
[in]viewIndexis the view to get the range data from to set on the scan criteria.
[in]modelRefis the model to scan.
[in]npcRangefractional coordinates (lower left 000, upper right 111) of partial view.
Returns
SUCCESS unless modelRef is invalid, then ERROR.
See also
mdlScanCritiera_setViewTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setViewRangeTest ( ScanCriteriaP  scanCriteriaP,
int  viewIndex,
DgnModelRefP  modelRef 
)

The mdlScanCriteria_setViewRangeIndex function is used to set the scan criteria range test to contain the contents of the specified model within the given view.

No other criteria are set.

Parameters
[in,out]scanCriteriaPis the scan criteria to modify.
[in]viewIndexis the view to get the range data from to set on the scan criteria.
[in]modelRefis the model to scan.
Returns
SUCCESS unless modelRef is invalid, then ERROR.
See also
mdlScanCritiera_setViewTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setViewTest ( ScanCriteriaP  scanCriteriaP,
int  viewIndex,
DgnModelRefP  modelRef 
)

The mdlScanCriteria_setViewTest function is used to set the specified scan

criteria to scan for the levels, class file and model that are displayable for the specified file in the specified view based on the current display flags, displayed levels and view model.

Element type test is set to display drawn elements. No range testing is enabled.

Parameters
[in,out]scanCriteriaPis the scan criteria to configure.
[in]viewIndexis the view within the design file to get the data from.
[in]modelRefindicates the model to be scanned.
Returns
SUCCESS if the operation was completed successfully, otherwise ERROR.
See also
mdlScanCriteria_setLocateTest mdlScanCriteria_setViewRangeTest
Remarks
Required Library: mdlbltin.lib
StatusInt mdlScanCriteria_setViewTestWithTypeMask ( ScanCriteriaP  scanCriteriaP,
int  viewIndex,
DgnModelRefP  modelRef,
UShort typeMask,
int  maskSize,
Int16  propmsk,
Int16  propval,
bool  setLockedTest,
Int16  noLocked 
)

Used to set the specified scan criteria to scan for the

levels, class file and model that are displayable for the specified file in the specified view based on the current display flags, displayed levels and view model.

Element type test is set to display drawn elements unless a typeMask is specified. No range testing is enabled.

Parameters
[in,out]scanCriteriaPis the scan criteria to configure.
[in]viewIndexis the view within the design file to get the data from.
[in]modelRefindicates the model to be scanned.
[in]typeMaskshould be 8 UShorts (NULL for drawn elements)
[in]maskSizesize (bytes) of the typeMask buffer
[in]propmskproperties mask
[in]propvalproperties value
[in]setLockedTestwhether to set lock test based on noLocked
[in]noLockednon-zero means don't allow selection of locked elements
Returns
SUCCESS if the operation was completed successfully, otherwise ERROR.
See also
mdlScanCriteria_setLocateTest mdlScanCriteria_setViewRangeTest
Remarks
Required Library: mdlbltin.lib

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