Modules | Functions
Element Location

Modules

 Element Location Criteria
 
 AutoLocate
 
 Snapping
 

Functions

DgnPlatform::HitGeomType mdlLocate_getHitGeomType ()
 CurrentHitFuncs ( mdlLocate_getCurrPath, mdlLocate_getCurrModelRef, mdlLocate_getComponentOffset, mdlLocate_getCurrHeaderFilePos, mdlLocate_changeCurrPath, mdlLocate_changeCurrPathByElemRef, mdlLocate_getHitPoint, mdlLocate_getHitView ) CurrentHitElemFuncs ( mdlLocate_Linear_getParameters, mdlLocate_Multiline_getParameters, mdlLocate_BSpline_getParameters, mdlLocate_Dimension_getParameters, mdlLocate_getProjectedPoint ) More...
 
DisplayPathCP mdlLocate_getCurrPath ()
 Get the DisplayPathCP of the currently located element. More...
 
DgnModelRefP mdlLocate_getCurrModelRef ()
 Get the ModelRef for the Current Hit. More...
 
UInt32 mdlLocate_getCurrHeaderFilePos ()
 Get the filePos of the header of the Current Hit. More...
 
UInt32 mdlLocate_getComponentOffset ()
 Get the offset of the currently selected component of the Current Hit. More...
 
StatusInt mdlLocate_changeCurrPath (UInt32 newFilePos, DgnModelRefP modelRef)
 Change the path of the Current Hit to a new element, using a new filePos and modelRef. More...
 
StatusInt mdlLocate_changeCurrPathByElemRef (ElementRefP elemRef, DgnModelRefP modelRef)
 Change the path of the Current Hit to a new element, using a new elementRef/modelRef pair. More...
 
void mdlLocate_hideElement (ElementRefP elemRef, DgnModelRefP modelRef, bool allowLocate, bool restoreHidden)
 Add an element to the list of hidden elements controlled by the Locate Process. More...
 
void mdlLocate_hiliteElement (ElementRefP elemRef, DgnModelRefP modelRef)
 Add an element to the list of hilited elements controlled by the Locate Process. More...
 
void mdlLocate_hilitePath (DisplayPathCP path)
 This function is equivalent to mdlLocate_hiliteElement, except that it accepts a full DgnPlatform::DisplayPath describing the element to be hilited. More...
 
void mdlLocate_dropFromHilited (DisplayPathCP path)
 Remove a path from the list of hilited elements. More...
 
DisplayPathCP mdlLocate_getHilitedPath (int index)
 Get the DgnPlatform::DisplayPath for one of the currently hilited elements. More...
 
StatusInt mdlLocate_getHitPoint (DPoint3dP hitPoint)
 Get the point on the element that generated the Current Hit. More...
 
int mdlLocate_getHitView ()
 Determine which view was used to locate the Current Hit. More...
 
StatusInt mdlLocate_Linear_getParameters (DSegment3dP segment, int *vertex, int *segmentNumber)
 Get the parameters that caused the Current Hit. More...
 
StatusInt mdlLocate_Multiline_getParameters (DSegment3dP segPoints, int *vertex, int *segmentNumber, int *lineNumber, int *capNumber, int *patIndex)
 Get the parameters that caused the Current Hit, if it was generated from a multiline element. More...
 
StatusInt mdlLocate_BSpline_getParameters (double *u, double *v)
 Get the parameters that caused the Current Hit, if it was generated from a bspline element. More...
 
StatusInt mdlLocate_Dimension_getParameters (UInt32 *partName, int *pointNo, UInt32 *segment, UInt32 *partType, UInt32 *partSubType)
 Get the parameters that caused the Current Hit, if it was generated from a dimension element. More...
 
StatusInt mdlLocate_getProjectedPoint (Dpoint3d *locatePoint, int *segment, int *view)
 Return information about the Current Hit. More...
 

Detailed Description

Function Documentation

StatusInt mdlLocate_BSpline_getParameters ( double *  u,
double *  v 
)

Get the parameters that caused the Current Hit, if it was generated from a bspline element.

Parameters
[out]uthe u parameter of the BSpline where the locate point is
[out]vthe v parameter of the BSpline where the locate point is
Returns
SUCCESS, unless no Current Hit, then ERROR. CurrentHitElemFuncs
StatusInt mdlLocate_changeCurrPath ( UInt32  newFilePos,
DgnModelRefP  modelRef 
)

Change the path of the Current Hit to a new element, using a new filePos and modelRef.

Parameters
[in]newFilePosfilePos of the new element
[in]modelRefspecifies the model containing the new element
Returns
SUCCESS if the operation was completed successfully.
See also
mdlLocate_changeCurrPathByElemRef CurrentHitFuncs
StatusInt mdlLocate_changeCurrPathByElemRef ( ElementRefP  elemRef,
DgnModelRefP  modelRef 
)

Change the path of the Current Hit to a new element, using a new elementRef/modelRef pair.

Parameters
[in]elemRefElementRefP containing the new element
[in]modelRefSpecifies the model containing the new element
Returns
SUCCESS if the operation was completed successfully.
See also
mdlLocate_changeCurrPath CurrentHitFuncs
StatusInt mdlLocate_Dimension_getParameters ( UInt32 partName,
int *  pointNo,
UInt32 segment,
UInt32 partType,
UInt32 partSubType 
)

Get the parameters that caused the Current Hit, if it was generated from a dimension element.

Parameters
[out]partNamecomplete part identifier for part of dimension located, use ADIM_GETTYPE, ADIM_GETSUB and ADIM_GETSEG to decompose
[out]pointNoclosest point in dimension element to locate point
[out]segmentselected dimension segment index
[out]partTypetype of the selected part of the dimension element, one of ADTYPE_xxx defined in mdldim.h.
[out]partSubTypesub type of the selected part of the dimension element, one of ADSUB_xxx defined in mdldim.h
Returns
SUCCESS, unless no Current Hit, then ERROR. CurrentHitElemFuncs
void mdlLocate_dropFromHilited ( DisplayPathCP  path)

Remove a path from the list of hilited elements.

If any paths that match the input path will be dropped from the hilite list and will also be unhilited from the screen.

Parameters
[in]patha DgnPlatform::DisplayPath to drop from hilite list.
See also
mdlLocate_hilitePath
UInt32 mdlLocate_getComponentOffset ( )

Get the offset of the currently selected component of the Current Hit.

Returns
The offset of the selected component or 0 for a non-complex element.
Remarks
mdlLocate_getCurrElemFilePos has been removed. A complex component no longer has a unique file position and will instead report the file position of it's outermost complex header. This function can be used to update code that was previously computing an offset using filePosComponent - filePosHeader. This offset can be supplied to mdlElmdscr_atOffset or mdlModify_elementDescr. CurrentHitFuncs
UInt32 mdlLocate_getCurrHeaderFilePos ( )

Get the filePos of the header of the Current Hit.

Returns
the filePos of the header of the Current Hit. CurrentHitFuncs
DgnModelRefP mdlLocate_getCurrModelRef ( )

Get the ModelRef for the Current Hit.

Returns
ModelRef of the Current Hit. CurrentHitFuncs
DisplayPathCP mdlLocate_getCurrPath ( )

Get the DisplayPathCP of the currently located element.

Returns
DgnPlatform::DisplayPath of the currently located element. CurrentHitFuncs
DisplayPathCP mdlLocate_getHilitedPath ( int  index)

Get the DgnPlatform::DisplayPath for one of the currently hilited elements.

Parameters
[in]indexthe index of the hilited element of interest. 0 means the first hilited element, -1 means the last one.
Returns
The path of the hilited element, or NULL if index is out of the range (or there are no hilited elements).
DgnPlatform::HitGeomType mdlLocate_getHitGeomType ( )

CurrentHitFuncs ( mdlLocate_getCurrPath, mdlLocate_getCurrModelRef, mdlLocate_getComponentOffset, mdlLocate_getCurrHeaderFilePos, mdlLocate_changeCurrPath, mdlLocate_changeCurrPathByElemRef, mdlLocate_getHitPoint, mdlLocate_getHitView ) CurrentHitElemFuncs ( mdlLocate_Linear_getParameters, mdlLocate_Multiline_getParameters, mdlLocate_BSpline_getParameters, mdlLocate_Dimension_getParameters, mdlLocate_getProjectedPoint )

The Current Hit Functions

The MicroStation Element Location process begins by creating a Hit List containing all of the DgnPlatform::HitPaths that satisfy the Search Criteria and pass all active Locate Filters. The Hit List is sorted so that the "best" Hit is first, and each subsequent Hit is "better" than all of the Hits after it.

After the Location process completes, the first Hit in the Hit List becomes the Current Hit. The Current Hit Functions provide access to the Current Hit to interrogate the element. Certain of the Current Hit Functions extract type-specific information from the Current Hit. To determin which of these functions to use, call mdlLocate_getHitGeomType to get the element type for the Current Hit.

As the user presses the Reset button, the Current Hit is removed and the next entry in the Hit List becomes the Current Hit until there are no more Hits. Get the type of geometry that generated the Current Hit. This function can be used to determine which of the other Current Hit functions can be used to extract information from the Current Hit.

Returns
type of geometry that generated the Current Hit. CurrentHitFuncs
StatusInt mdlLocate_getHitPoint ( DPoint3dP  hitPoint)

Get the point on the element that generated the Current Hit.

Parameters
[out]hitPointthe point on the element that generated the Current Hit.
Returns
ERROR if there is no Current Hit.
Remarks
The point returned is in world coordinates. CurrentHitFuncs
int mdlLocate_getHitView ( )

Determine which view was used to locate the Current Hit.

Returns
view that was used to locate the Current Hit. CurrentHitFuncs
StatusInt mdlLocate_getProjectedPoint ( Dpoint3d locatePoint,
int *  segment,
int *  view 
)

Return information about the Current Hit.

Parameters
[out]locatePointis the point on the current element that is closest to the locate point. It is returned in the current coordinate system.
[out]segmentIf the current element is a line string, shape, or curve, segment is the segment number from which locatePoint was derived.
[out]viewis the view number used to locate the current element.
Returns
ERROR if there is no Current Hit (in which case the values for point, segment, and view are not set.) Otherwise, SUCCESS.
Remarks
Note: this function is provided for compatibility with pre-V8 version of MicroStation only. CurrentHitElemFuncs
void mdlLocate_hideElement ( ElementRefP  elemRef,
DgnModelRefP  modelRef,
bool  allowLocate,
bool  restoreHidden 
)

Add an element to the list of hidden elements controlled by the Locate Process.

All hidden elements are cleared (shown) by calling mdlLocate_clear or mdlLocate_init.

Parameters
[in]elemRefthe element ref to hide
[in]modelRefthe modelRef for elemRef
[in]allowLocatetrue to allow locates/snaps to the hidden element.
[in]restoreHiddentrue to show the hidden element again.
See also
mdlLocate_hiliteElement
void mdlLocate_hiliteElement ( ElementRefP  elemRef,
DgnModelRefP  modelRef 
)

Add an element to the list of hilited elements controlled by the Locate Process.

All hilited elements are cleared (unhilited) by calling mdlLocate_clear or mdlLocate_init.

Parameters
[in]elemRefthe element ref to hilite
[in]modelRefthe modelRef for elemRef
See also
mdlLocate_hilitePath
void mdlLocate_hilitePath ( DisplayPathCP  path)

This function is equivalent to mdlLocate_hiliteElement, except that it accepts a full DgnPlatform::DisplayPath describing the element to be hilited.

Parameters
[in]paththe DgnPlatform::DisplayPath to hilite.
See also
mdlLocate_hiliteElement
StatusInt mdlLocate_Linear_getParameters ( DSegment3dP  segment,
int *  vertex,
int *  segmentNumber 
)

Get the parameters that caused the Current Hit.

if it was generated from a "linear" element.

Parameters
[out]segmentthe segment of the element (in world coordinates)
[out]vertexthe vertex of the element that is nearest the locate point
[out]segmentNumberthe 0 based index of the segment number located
Returns
SUCCESS, unless no Current Hit, then ERROR. CurrentHitElemFuncs
StatusInt mdlLocate_Multiline_getParameters ( DSegment3dP  segPoints,
int *  vertex,
int *  segmentNumber,
int *  lineNumber,
int *  capNumber,
int *  patIndex 
)

Get the parameters that caused the Current Hit, if it was generated from a multiline element.

Parameters
[out]segPointsthe segment points closest to the locate point
[out]vertexthe multi-line vertex closest to the locate point
[out]segmentNumberthe 0 based index of the multi-line segment
[out]lineNumberthe index of the line within the multi-line
[out]capNumberthe index of the cap closest to the located point
[out]patIndexthe index of the pattern in the segment of the located point if a pattern is applied
Returns
SUCCESS, unless no Current Hit, then ERROR. CurrentHitElemFuncs

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