Namespaces | Classes | Functions

Namespaces

 Bentley
 The Bentley namespace contains types defined by the Bentley Library.
 
 Bentley::DgnPlatform
 The DgnPlatform namespace contains types defined by the DgnPlatform.
 

Classes

struct  IDimCreateData
 An object of this type is required to supply necessary information to DimensionHandler::CreateDimensionElement. More...
 
struct  IDimensionQuery
 Query an element for dimension specific properties. More...
 
struct  IDimensionEdit
 Modify and Query dimension specific properties of an element. More...
 
struct  DimensionTextPartId
 ! While querying a dimension using ITextEdit and ITextQuery the returned ! object is a DimensionTextPartId. More...
 
struct  DimensionHandler
 The default type handler for Dimension elements (type: DIMENSION_ELM). More...
 

Functions

 DGNPLATFORM_TYPEDEFS (IDimCreateData)
 
int mdlDim_create (MSElementP dim, MSElementCP seed, RotMatrixP rMatrix, DgnPlatform::DimensionType dimType, int dimView)
 Creates an empty dimension element. More...
 
void mdlDim_defineRotMatrix (RotMatrixP rMatrix, MSElementP dim, DPoint3dCP point1, DPoint3dCP point2, DPoint3dCP point3)
 Defines the rotation matrix for a dimension. More...
 
void mdlDim_setRotMatrix (MSElementP dimElement, RotMatrixP rMatrix)
 Sets the rotation matrix for a dimension. More...
 
int mdlDim_setHeight (MSElementP dim, double height, int relative)
 Sets the height for a linear or angular dimension. More...
 
int mdlDim_setTextOffset (MSElementP dim, int segNo, int justify, double offset)
 Changes the dimenension's text location in the direction of the dimension line. More...
 
void mdlDim_getRotMatrix (MSElementCP dim, RotMatrixP rMatrix)
 Extracts the rotation matrix from a dimension. More...
 
int mdlDim_insertPoint (MSElementP dimP, DPoint3dCP newPointP, DgnPlatform::AssocPoint *assocPointP, int pointNo, int option)
 Inserts the given point into a dimension. More...
 
int mdlDim_getStrings (DgnPlatform::DimStrings *dimStrings, DgnPlatform::DimStringConfig *config, MSElementCP dim, int segNo)
 Extracts the user text strings from a dimension. More...
 
int mdlDim_setStrings (MSElementP dim, int segNo, DgnPlatform::DimStrings *dimStrings)
 Replaces the strings in a dimension. More...
 
int mdlDim_getActualValues (MSElementP dim, double *pdValues)
 Extracts the actual measured values from all segments of a dimension. More...
 
StatusInt mdlDim_setTextStyle (MSElementP pDimElm, const MdlTextStyle *pTextStyle)
 Set the text style properties of a dimension element. More...
 
StatusInt mdlDim_getDimStyleName (WCharP pName, int numChars, MSElementCP pDimElm, DgnModelRefP modelRef)
 Get the name of the dimension style used by a dimension. More...
 
int mdlDim_getElementDescr (MSElementDescrH edPP, MSElementCP dim, DgnModelRefP modelRef, int grphGrp)
 Converts a dimension element to a chain of geometric primitive elements. More...
 
int mdlDim_deletePoint (MSElementP dim, int pointNo)
 Deletes the vertex at pointNo from a dimension element. More...
 
int mdlDim_extractPoints (DPoint3dP outPoints, MSElementCP dim, int pointNo, int nPoints)
 Extracts the definition points from a dimension. More...
 

Detailed Description

Function Documentation

DGNPLATFORM_TYPEDEFS ( IDimCreateData  )
int mdlDim_create ( MSElementP  dim,
MSElementCP  seed,
RotMatrixP  rMatrix,
DgnPlatform::DimensionType  dimType,
int  dimView 
)

Creates an empty dimension element.

If seed is not NULL, all dimension settings are taken from seed.

Parameters
[out]dimnew dimension element
[in]seedseed dimension element or NULL
[in]dimTypedetermines the type of dimension created. Ex. DimensionType::SizeArrow, see table below for a complete list.
[in]dimViewspecifies the view (0-7) used for text orientation.
[in]rMatrixdimension element rotation matrix. Pass NULL for identity.
Remarks
After mdlDim_create is called, the definition points must be added to the element with mdlDim_insertPoint. The modified dimension element must be validated with mdlDim_validate before it is written to the file.
Valid values for dimType
DimensionType::SizeArrow
DimensionType::SizeStroke
DimensionType::LocateSingle
DimensionType::LocateStacked
DimensionType::AngleSize
DimensionType::ArcSize
DimensionType::AngleLocation
DimensionType::ArcLocation
DimensionType::AngleLines
DimensionType::AngleAxis
DimensionType::Radius
DimensionType::Diameter
DimensionType::DiameterParallel
DimensionType::DiameterPerpendicular
DimensionType::CustomLinear
DimensionType::Ordinate
DimensionType::RadiusExtended
DimensionType::DiameterExtended
DimensionType::Center
DimensionType::AngleAxisX
DimensionType::AngleAxisY
DimensionType::LabelLine
DimensionType::Note
Returns
status
See also
mdlDim_insertPoint mdlDim_validate
void mdlDim_defineRotMatrix ( RotMatrixP  rMatrix,
MSElementP  dim,
DPoint3dCP  point1,
DPoint3dCP  point2,
DPoint3dCP  point3 
)

Defines the rotation matrix for a dimension.

Can be used with the following types of dimensions:

  • DimensionType::SizeArrow
  • DimensionType::SizeStroke
  • DimensionType::CustomLinear
  • DimensionType::LocateSingle
  • DimensionType::LocateStacked
  • DimensionType::Ordinate
Parameters
[out]rMatrixrotation matrix
[in,out]dimdimension element
[in]point1first point
[in]point2second point
[in]point3third point
Remarks
The rotation matrix produced is based on the three input points and the dimension's alignment setting. The three points correspond to the first three points that would be input to the DIMENSION SIZE, DIMENSION LOCATION or DIMENSION ORDINATE commands.
This function automatically adds the rotation matrix to the dimension. mdlDim_setRotMatrix does not need to be called after this function is called. If rMatrix is not NULL, a copy of the rotation matrix is returned there.
The modified dimension element must be validated with mdlDim_validate before it is written to the file.
See also
mdlDim_getRotMatrix mdlDim_setRotMatrix mdlDim_validate
int mdlDim_deletePoint ( MSElementP  dim,
int  pointNo 
)

Deletes the vertex at pointNo from a dimension element.

Parameters
[in,out]dimDimension element
[in]pointNoPoint to delete
Remarks
The modified dimension element must be validated with mdlDim_validate before it is written to the file.
Returns
SUCCESS if the point is deleted
See also
mdlDim_insertPoint
Remarks
Required Library: mdlbltin.lib
int mdlDim_extractPoints ( DPoint3dP  outPoints,
MSElementCP  dim,
int  pointNo,
int  nPoints 
)

Extracts the definition points from a dimension.

Parameters
[out]outPointsmust be at least nPoints* sizeof(DPoint3d) bytes.
[in]dimdimension element
[in]pointNofirst point to extract
[in]nPointsnumber of points to extract
Returns
the number of points that were extracted
See also
mdlDim_insertPoint mdlDim_deletePoint
Remarks
Required Library: mdlbltin.lib
int mdlDim_getActualValues ( MSElementP  dim,
double *  pdValues 
)

Extracts the actual measured values from all segments of a dimension.

These values are different from the displayed values in that they do not include the dimension scale, have not been converted to the dimension units, and have not been rounded.

Parameters
[in]dimDimension element
[in]pdValuesA pointer to an array of doubles. See Remarks.
Remarks
The number of elements in the array pointed to by pdValues should be at least equal to the number of segments in the dimension. The largest possible number of elements is MAX_ADIM_POINTS. The caller may wish to simply declare a local array of MAX_ADIM_POINTS elements, then pass that array into this function.

The initial contents of this array are irrelevant. Upon return, the first N elements will be populated with the actual values of the segments, where N is equal to the number of segments in the dimension element.

Returns
status (SUCCESS if no errors).
See also
mdlDim_getNumberOfSegments
Remarks
Required Library: mdlbltin.lib
StatusInt mdlDim_getDimStyleName ( WCharP  pName,
int  numChars,
MSElementCP  pDimElm,
DgnModelRefP  modelRef 
)

Get the name of the dimension style used by a dimension.

Parameters
[out]pNameDimension style name
[in]numCharsnumber of characters in output buffer (usually MAX_DIMSTYLE_NAME_LENGTH)
[in]pDimElmDimension Element
[in]modelRefmodelRef
Returns
status
Remarks
If the dimension does not use a style, the returned style name will be empty.
Required Library: mdlbltin.lib
int mdlDim_getElementDescr ( MSElementDescrH  edPP,
MSElementCP  dim,
DgnModelRefP  modelRef,
int  grphGrp 
)

Converts a dimension element to a chain of geometric primitive elements.

Parameters
[out]edPPElement descriptor
[in]dimDimension element
[in]modelRefDimension element model ref
[in]grphGrpIf true, the result elements will all be assigned to a new graphic group
Remarks
It is the responsibility of the caller to free the memory allocated to edP by calling mdlElmdscr_freeAll.
Returns
SUCCESS if the element descriptor is created.
Remarks
Required Library: mdlbltin.lib
void mdlDim_getRotMatrix ( MSElementCP  dim,
RotMatrixP  rMatrix 
)

Extracts the rotation matrix from a dimension.

Parameters
[in]dimDimension element
[out]rMatrixRotation Matrix
See also
mdlDim_defineRotMatrix mdlDim_validate
int mdlDim_getStrings ( DgnPlatform::DimStrings dimStrings,
DgnPlatform::DimStringConfig config,
MSElementCP  dim,
int  segNo 
)

Extracts the user text strings from a dimension.

Parameters
[out]dimStringstext strings
[out]configstring configuration
[in]dimdimension element
[in]segNosegment containing the dimension text. The first text string encountered in a dimension element is in segment zero.
Remarks
To determine the configuration of strings in dimStrings, check the flags in config which are described in DgnPlatform::DimStringConfig.
Unless strings were added by mdlDim_setStrings, all strings will be blank. (In this case, the displayed string is generated automatically.)
An asterisk in a string is used as a place holder for the dimension value.
Returns
status
See also
mdlDim_setStrings
Remarks
Required Library: mdlbltin.lib
int mdlDim_insertPoint ( MSElementP  dimP,
DPoint3dCP  newPointP,
DgnPlatform::AssocPoint assocPointP,
int  pointNo,
int  option 
)

Inserts the given point into a dimension.

Parameters
[in,out]dimPdimension element
[in]newPointPthe point to add, unless the option specified is POINT_ASSOC in which case assocPointP is the point to add. newPointP may also be used if POINT_CHECK fails when using POINT_ASSOC.
[in]assocPointPused if option is POT_ASSOC. Assoc points can be created using the mdlAssoc functions, ex. mdlAssoc_createLinear
[in]pointNoposition to insert point (negative for last).
[in]optiondetermines the content of newPoint and must be set to one of the constants defined below
Remarks
Valid values for option
Value Description
POINT_STD newPointP is inserted as a non-associative point
POINT_ASSOC assocPointP is inserted as an associative point
POINT_CHECK if the assoc-lock is active, and the user is currently snapped, the active snap is used to create an associative point which is inserted. Otherwise newPointP is inserted as a non-associative point
The modified dimension element must be validated with mdlDim_validate before it is written to the file.
Returns
status
See also
mdlDim_deletePoint
Remarks
Required Library: mdlbltin.lib
int mdlDim_setHeight ( MSElementP  dim,
double  height,
int  relative 
)

Sets the height for a linear or angular dimension.

The height is the distance from the first dimensioned point to the dimension line of the first segment.

This function works only for the following dimension types:

  • DimensionType::SizeArrow
  • DimensionType::SizeStroke
  • DimensionType::CustomLinear
  • DimensionType::LocateSingle
  • DimensionType::LocateStacked
  • DimensionType::AngleSize
  • DimensionType::AngleLocation
  • DimensionType::AngleLines
  • DimensionType::AngleAxisX
  • DimensionType::AngleAxisY
Parameters
[in,out]dimdimension to modify
[in]heightnew height
[in]relativethis option is not currently used, pass 0
Returns
status
See also
mdlDim_setTextOffset mdlDim_setHeight
Remarks
Required Library: mdlbltin.lib
void mdlDim_setRotMatrix ( MSElementP  dimElement,
RotMatrixP  rMatrix 
)

Sets the rotation matrix for a dimension.

Remarks
The modified dimension element must be validated with mdlDim_validate before it is written to the file.
Parameters
[in]dimElementdimension element
[out]rMatrixrotation matrix
See also
mdlDim_defineRotMatrix mdlDim_validate
Remarks
Required Library: mdlbltin.lib
int mdlDim_setStrings ( MSElementP  dim,
int  segNo,
DgnPlatform::DimStrings dimStrings 
)

Replaces the strings in a dimension.

Parameters
[in,out]dimdimension element
[in]segNosegment containing the dimension text. The first text string encountered in a dimension element is in segment zero.
[out]dimStringsdimension text strings
Remarks
You should always call mdlDim_getStrings first, to determine the proper structure of dimStrings. The use of the DgnPlatform::DimStrings type is discussed with mdlDim_getStrings.
Any asterisk in the dimension string will be replaced by the dimension value during display.
The modified dimension element must be validated with mdlDim_validate before it is written to the file.
Returns
status
See also
mdlDim_getStrings
Remarks
Required Library: mdlbltin.lib
int mdlDim_setTextOffset ( MSElementP  dim,
int  segNo,
int  justify,
double  offset 
)

Changes the dimenension's text location in the direction of the dimension line.

Parameters
[in,out]dimdimension to modify
[in]segNosegment containing the dimension text to move. The first text string encountered in a dimension element is in segment zero.
[in]justifymust be set to one of the constants listed below.
[in]offsetthe distance from the dimension line origin to the dimension text origin measured along the dimension line. Used only if justify is set to DIMTEXT_OFFSET.
Remarks
Valid values for justify
Value Description offset
DIMTEXT_LEFT Text left-justified in the dimension line ignored
DIMTEXT_CENTER Text centered in the dimension line ignored
DIMTEXT_RIGHT Text right-justified in the dimension line ignored
DIMTEXT_OFFSET Text positioned by the value of offset used
The modified dimension element must be validated with mdlDim_validate before it is written to the file.
Returns
status
See also
mdlDim_setHeight mdlDim_validate
Remarks
Required Library: mdlbltin.lib
StatusInt mdlDim_setTextStyle ( MSElementP  pDimElm,
const MdlTextStyle pTextStyle 
)

Set the text style properties of a dimension element.

These properties are stored for each dimension, and will be automatically updated if the dimension is being controlled by a text style.

Parameters
[in,out]pDimElmDimension Element
[in]pTextStyletext style properties
Returns
status
Remarks
When the text properties are set, it is usually necessary to also call mdlDim_setTextStyleID.
Required Library: mdlbltin.lib

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