DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Expand DG Kernel ComponentsDG Kernel Components
Expand API ReferenceAPI Reference
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > Models > Entities > Model Items > Measurements > Persistent Measurements Search Documentation


Persistent Measurements

See also: Measurements Overview

Persistent measurements are part of the model. Once added to the scene they persist during viewing manipulations: rotations etc. Note that persistent measurements are not saved and loaded with the model. Contact us to request this feature. Persistent mode is the default mode of the component.

To add a distance measurement:

  • If the view is three dimensional make sure the surface is not facing the viewer flat (normal to the surface should have some non-zero angle with direction toward the viewer)
  • Make sure the view has focus (click into the window) and press 'm' key to enter the measurement mode.
  • Select the first point on surface of any object in 3D or any point in 2D with left mouse button. The first selected point will be identified by a distance line from the current mouse location
  • Select the second point on surface of any object in 3D or any point in 2D  with left mouse button.
  • Move mouse away from distance line (preferably in direction of the surface normal) to define location of the text box showing the distance. By default, the text box will be positioned in the middle of the dimension line.

To modify location of measurement text box

  • Enter the measurement mode
  • Press 'n' key
  • Select a measurement text box with the mouse and move it around while keeping the left mouse button down
  • Click outside the text box to deselect the item.

To modify direction of limit lines

  • Enter the measurement mode
  • Press 'n' key
  • Select an end of one of the limit lines and move it to rotate the line around the distance line
  • Click outside the ends to deselect the item.

To delete a measurement

  • Enter the measurement mode
  • Press 'n' key
  • Select a measurement text box and press Delete key

To delete all measurements

  • Enter the measurement mode
  • Press 'd' key

To obtain coordinates of a selected point

  • Enter the measurement mode
  • Press 'p' key
  • Select any point on the screen. Move mouse to position the text box with coordinates. Unless disabled via UseClipboard property, coordinates of the selected point will also be copied to the clipboard. In 3D mode the selected point will be located on surface of the object under the mouse or in the viewing plane if there is no object.

To append units string to the measurement text

To use a measurement as a 3D text label

To change displayed number of digits in the measurement text

To change snap to line tolerance

To change snap to point tolerance

Measurements are viewing functionality and are not stored with the model. Contact us if your application requires persistent measurements

Programming Measurements

To add a measurement to 3D scene model programmatically:

  1. Call IDIObjGenerator.Create or IDIObjGenerator.Create2 with parameter eType = EObjectType.eObjTypeMeasurement
  2. Query IItem from the returned IUnknown
  3. Use IArray or IArray2 queried from IModel to add the new item to the model
  4. Query IMeasurement_KC from the above IItem
  5. Use methods of IMeasurement_KC to modify measurement points, positioning of the text pox and the displayed text

To programmatically modify an existing measurement in 3D scene:

Use steps 3 - 5 from the above

To add a measurement to two dimensional scene:

  1. Obtain IKCContext via DG Kernel > GetView > IView > I2DView_KC > I2DView_KC.GetContext
  2. Query IArray2 from the IKCContext
  3. Call IArray2.InsertNew(EObjectType.eObjTypeMeasurement, 0). 0 can be replaced here with any valid index.
  4. Call IArray2.GetAt(0) to retrieve the newly created 2D scene item. The returned interface has actual type of IItem
  5. Query IMeasurement_KC from the returned interface
  6. Use methods of IMeasurement_KC to modify measurement points, positioning of the text pox and the displayed text

To programmatically modify an existing measurement in two dimensional scene:

Use the above and skip the step 3