KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Models > Scene Items > Measurements > Measurements
Measurements

Measurements

See also: DemoDirect User Access demo

Measurement mode of KernelCAD views allows adding items, which display distances between points, coordinates of a selected point and angles. A measurement can also be modified programmatically to display a single line of text so that it will act as a text label attached to the specified surface.

To enter the measurement mode make sure the view has focus (click into the window) and press 'm' key. The measurement mode has several sub modes and a "delete all" command. The component exits the measurement mode automatically when the current operation is either completed or interrupted.

The Advanced > Measurements > Add context menu (right mouse click) options offer a user interface for entering the mode.

KernelCAD componets have two styles of measurements: Persistent measurements and Transient (default) measurements

Transient measurements disappear once the measurement mode is exited.They can be used to quickly check distances and avoid adding extra items obscuring the scene

Transient measurements style (default) can be re-activated programmatically by setting the MeasurementsStyle property of KernelCAD Context to 1.

Persistent measurements are part of the model. Once added to the scene they persist during viewing manipulations: rotations etc

To switch between the modes at runtime got to Advanced > Measurements > Style in context menu (right mouse click)

Persistent measurements style can also be activated programmatically by setting the MeasurementsStyle property of KernelCAD Context to 0.

See Persistent Measurements topic for more details

When MeasurementsShowOnMouseMove property of KernelCAD Context is set to true (false is the default) the component displays distance between the first point of the measurement and the current position of the mouse during movement from the first to the second point. The distance is measured along plane parallel to plane of the screen and recalculated precisely after the second point has been selected.

Point selection for large surfaces can be slow. Setting the SelectionGeometric context property to false improves performance but reduces precison, particularily around edges of objects

Angle Measurements

To measure angle in the screen plane between a line and horizontal direction select Advanced > Measurements > Add > Angle in the context menu and click two points on the screen to define a line.

To measure angle in the screen plane with arbitrary direction hold Control key while clicking Advanced > Measurements > Add > Angle option in the menu. This action will open Angle Measurement Options dialog. Make sure the "View Plane" option is selected and clear the "Horizontal" check box. The software will use the next two clicks to define the direction. The third click will show the angle.

To measure angle on a surface hold Control key while clicking Advanced > Measurements > Add > Angle option in context menu. In the Angle Measurement Options dialog select "Surface" option and click OK. The next two clicks will define a line between two points on surface of object(s). The third click will show angle between the line and line between first and third points. During mouse movement the operation displays angle in screen plane. The final angle shown after the third click is calculated for the points picked on surface. When the mouse is clicked outside any object the result should be considered unreliable.

To make the above options programmatically query context of angle measurements via: KernelCAD > GetView() > IKCContext > GetParam(0) > object (or IUnknown) > IKCContext. Properties of the returned context are:

Property Description Type Parameter ID Default
ShowDialog Show Angle Measurement Options dialog on Advanced > Measurements > Add > Angle (+Ctrl) Boolean 0 True
AngleOnSurface Measure angle in surface of the object under the mouse Boolean 1 True
DefineHorizon Define a line to measure the angle againts with the first two clicks Boolean 2 True
Max90degrees If false the angle shown will always be measured against the positive x axis or the defined direction and can be any number in (-180, 180] range Boolean True

When ShowDialog is set to false the dialog will not be displayed. If the property is true, other properties will be displayed in the dialog for modification.

See OnFormLoad() method of DIView sample (C#) or  CLightDlg::InitBackground() function of Light sample (C++)  for an example.