Functions
FenceProcessing

Functions

void mdlFence_clear (bool erase)
 Clears the current fence. More...
 
void mdlFence_fromView (int view)
 Creates a fence from a view's extents. More...
 
void mdlFence_fromDesign (int view, DgnModelRefListP modelRefList)
 Creates a fence from the design file(s) extents. More...
 
void mdlFence_fromUniverse (int view)
 Creates a fence from the size of the design plane. More...
 
int mdlFence_fromElement (MSElementDescrP edP, int view)
 Creates a fence from a closed element, i.e., shape, ellipse, complex shape, or closed B-spline curve. More...
 
StatusInt mdlFence_fromElementRef (ElementRefP elemRef, DgnModelRefP modelRef, int view)
 Creates a fence from a closed element or surface/solid of projection. More...
 
int mdlFence_toElement (MSElementDescrH edPP)
 Creates an element from the active fence. More...
 
void mdlFence_fromShape (MSElementP shape)
 Creates a fence using the specified shape element to define the outline. More...
 
int mdlFence_process (CallbackArgP arg)
 Scans the design file and all reference files, calling the contents function for each accepted element. More...
 
int mdlFence_processClearSelectionSetOpt (CallbackArgP arg, bool clearSelectionSet)
 Process fence and optionally clear the selection set. More...
 
int mdlFence_setFromPoints (DPoint2d *ptsP, int numPts, int view)
 Creates a fence from an array of points. More...
 
bool mdlFence_isDefined ()
 Returns true if fence is defined. More...
 
bool mdlFence_isDefinedByElement ()
 Returns true if fence is defined by an element. More...
 
StatusInt mdlFence_saveNamed (DgnModelRefP modelRef, const WChar *pName, const WChar *pDescription, DgnPlatform::ElementId fenceElementId, DgnModelRefP fenceElementModelRef)
 Save named fence with name and description. More...
 
StatusInt mdlFence_deleteNamed (DgnModelRefP modelRef, const WChar *pName)
 Delete named fence. More...
 
StatusInt mdlFence_findNamedFence (ElementRefP *pElementRef, DgnModelRefP *pElementModelRef, DgnModelRefP modelRef, WCharCP pName)
 Find named fence and return elementRef/modelRef for the named fence element. More...
 

Detailed Description

Function Documentation

void mdlFence_clear ( bool  erase)

Clears the current fence.

Also synchronizes or sets the enabled state of dialog items which depend on whether or not a fence is active.

Parameters
[in]erasetrue to erase the current fence.
StatusInt mdlFence_deleteNamed ( DgnModelRefP  modelRef,
const WChar pName 
)

Delete named fence.

Returns
SUCCESS if the named fence is successfully deleted and an appropriate error status otherwise.
Parameters
[in]modelRefindicates the file containing the fence to be deleted.
[in]pNameThe fence name.
StatusInt mdlFence_findNamedFence ( ElementRefP pElementRef,
DgnModelRefP pElementModelRef,
DgnModelRefP  modelRef,
WCharCP  pName 
)

Find named fence and return elementRef/modelRef for the named fence element.

Returns
SUCCESS if the named fence is successfully found and an appropriate error status otherwise.
Parameters
[out]pElementRefElementRefP for the named fence element
[out]pElementModelRefDgnModelRefP for the named fence element model.
[in]modelRefindicates the file containing the fence.
[in]pNameThe fence name.
void mdlFence_fromDesign ( int  view,
DgnModelRefListP  modelRefList 
)

Creates a fence from the design file(s) extents.

Parameters
[in]viewthe view to draw the fence in
[in]modelRefListthe list of models to get include extents of.
Returns
This function is of type void and returns no value.
int mdlFence_fromElement ( MSElementDescrP  edP,
int  view 
)

Creates a fence from a closed element, i.e., shape, ellipse, complex shape, or closed B-spline curve.

Non-linear segments of the closed element, if any, are stroked into multiple linear segments.

Parameters
[in]edPthe element descriptor of the closed element
[in]viewthe index of the view to draw the fence in
Returns
SUCCESS, or ERROR if edP is not valid or does not contain a closed element
StatusInt mdlFence_fromElementRef ( ElementRefP  elemRef,
DgnModelRefP  modelRef,
int  view 
)

Creates a fence from a closed element or surface/solid of projection.

Parameters
[in]elemRefthe element that defines the fence.
[in]modelRefthe model ref
[in]viewthe index of the view to draw the fence in
Returns
SUCCESS, or ERROR if ID does not point to a valid element
void mdlFence_fromShape ( MSElementP  shape)

Creates a fence using the specified shape element to define the outline.

Parameters
[in]shapeshape element to be copied to create the fence
Remarks
Before calling mdlFence_fromShape, the application should set the variable tcb->fenvw to the view number (minus 1).
Returns
mdlFence_fromShape is of type void; it returns no value
See also
mdlFence_toShape
void mdlFence_fromUniverse ( int  view)

Creates a fence from the size of the design plane.

The resultant fence is large enough to contain all elements within the design plane.

Parameters
[in]viewthe index of the view to draw the fence in
Returns
This function is of type void and returns no value.
void mdlFence_fromView ( int  view)

Creates a fence from a view's extents.

Parameters
[in]viewindex of the view to create the fence from
bool mdlFence_isDefined ( )

Returns true if fence is defined.

Returns
true if a fence is defined (either by points or element).
bool mdlFence_isDefinedByElement ( )

Returns true if fence is defined by an element.

Returns
true if a fence is defined by element.
int mdlFence_process ( CallbackArgP  arg)

Scans the design file and all reference files, calling the contents function for each accepted element.

Parameters
[in]argargument passed to content routine
Remarks
Uses the current fence and the fence locks. The argument arg (passed to mdlFence_process) is passed to the contents function; MicroStation does not use this argument. It is generally used to point to a structure that contains arguments and/or status information between the function calling mdlFence_process and the contents function.
See the description of mdlState_fenceContent for further explanation of the contents function and mdlState_fenceOutline for further explanation of the fence outline function.
When the fence processing is complete, mdlFence_process calls the current fence outline function to update the fence.
The content and outline functions are set with mdlState_startFenceCommand.
Returns
SUCCESS
See also
mdlState_startFenceCommand userState_fenceContent userState_fenceOutline mdlFence_processClearSelectionSetOpt
int mdlFence_processClearSelectionSetOpt ( CallbackArgP  arg,
bool  clearSelectionSet 
)

Process fence and optionally clear the selection set.

This function is similar to the mdlFence_process function, except that the selection set can optionally be cleared by setting clearSelectionSet to true.

Parameters
[in]argargument passed to content routine
[in]clearSelectionSetif true, the selection set is cleared
Returns
SUCCESS
See also
mdlFence_process mdlState_startFenceCommand userState_fenceContent userState_fenceOutline
StatusInt mdlFence_saveNamed ( DgnModelRefP  modelRef,
const WChar pName,
const WChar pDescription,
DgnPlatform::ElementId  fenceElementId,
DgnModelRefP  fenceElementModelRef 
)

Save named fence with name and description.

Returns
SUCCESS if the fence is successfully saved and an appropriate error status otherwise.
Parameters
[in]modelRefindicates the file in which to save the named fence.
[in]pNameThe fence name - maximum number of chars is MAX_NAMEDFENCE_NAME_LENGTH - must be unique among named fences in the file.
[in]pDescriptionThe fence description - maximum number of chars is MAX_NAMEDFENCE_DESCR_LENGTH
[in]fenceElementIdDgnPlatform::ElementId for fence element
[in]fenceElementModelRefthe ModelRef for fence element - currently this must be same as modelRef.
int mdlFence_setFromPoints ( DPoint2d ptsP,
int  numPts,
int  view 
)

Creates a fence from an array of points.

Parameters
[in]ptsPthe array of points to use to create the fence
[in]numPtsthe number of points in the array
[in]viewthe view in which the fence is created.
Returns
SUCCESS if the fence is successfully created from the points.
See also
mdlFence_toElement
int mdlFence_toElement ( MSElementDescrH  edPP)

Creates an element from the active fence.

Parameters
[out]edPPelement descriptor for the element created from the fence.
Returns
SUCCESS if the element was created successfully.
See also
mdlFence_setFromPoints

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