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 > Grid
Grid

Measurement Grid

A 3D view grid can be added to KernelCAD view for quick estimation of distances and locations.

To display/hide a grid select Advanced > View > Grid in the context menu of the component and turn on/off the Enabled check box in the grid properties form.

The grid can be rotated around its perpendicular at the origin (0, 0) by the "Rotate By" angle. If there was an angle measurement in screen plane the "Use Last Measured Angle" check box will be enabled. It allows copying the angle into the edit box.If "Interactive" check box is on, the grid can be rotated with up/down mouse movements on closing the dialog until the next mouse click.

If Control key was held, while selecting the Advanced > View > Grid menu option the grid dialog is skipped and default options are used to define the grid. The defaults can be changed using GridDefaultInteractive and GridDefaultUseMeasuredAngle properties of the component's context.

Grid has three styles: Infinite Dynamic, Model Space grid and 3D Background. Its postion and orientation can be modifies from the context menu properties dialog or programmatically. Lines of a Dynamic Grid are visible through opaque objects.

Programmatic access

There is no special interface for manipulation of grids. To enable or manipulate the grid programmatically obtain IKCContext of the grid via:

KernelCAD conponent > GetView() > IPropertyArray > IPropertyArray.GetProperty("3DGrid", ...) > IKCContext

To modify color of lines and text query IKCContext2 from IKCContext

To modify position and orientation of the grid query IFrame from the IKCContext. See DIView sample for an example.

Spacing of the grid can be modified in Dynamic mode by using the Step property and in Model Space mode by using the StepModelSpace property. See the table below for details

Properties of the grid

Property Description Type Parameter ID Default
Enabled Determines whether the grid is rendered Boolean 0 True
Style 0 - Infinite Dynamic, 1 - Model Space, 2 - 3D Background Integer 0
Step Valid only when Style property above is 0. This is an indirect parameter in range 50 to 1000 which has to be tuned in for each application. Reducing the parameter makes the grid finer Integer 1 200
StepModelSpace Valid only when Style property above is 1. Geometric distance between grid lines Double 0 1.0
ColorLines Color of lines. Query IKCContext2 from IKCContext to access Color 1 rgba=(0.6, 0.8, 0.6, 1)
ColorText Color of the location text for Dynamic style or grid size text for the Model Space style Color 0 rgba=(0.2, 0.2, 1, 1)
ShowGridSize Related to the Model Space style only. Display the grid step size in the upper right corner of the window Boolean 1 True
  3D Background      
Subdivision type 0 - by step size, 1 - by number of steps, 2 - automatic detection Integer 4 2
Step size X Step size along axis X (valid only for subdiv. type - "0") Double 8 1.0
Step size Y Step size along axis Y (valid only for subdiv. type - "0") Double 9 1.0
Step size Z Step size along axis Z (valid only for subdiv. type - "0") Double 10 1.0
Step count X Step count along axis X (valid only for subdiv. type - "1") Integer 5 10
Step count Y Step count along axis Y (valid only for subdiv. type - "1") Integer 6 10
Step count Z Step count along axis Z (valid only for subdiv. type - "1") Integer 7 10
Axis name X Name of the axis X (legend) String 0 10
Axis name Y Name of the axis Y (legend) String 1 10
Axis name Z Name of the axis Z (legend) String 2 10
Digits font Font name for numbers String 3 Calibri Light
Legend font Font name for axis names String 4 Calibri Light
Digits font size Size of the font for numbers Integer 2 60
Legend font size Size of the font for axis names Integer 11 70
Color style 0 - Solid, 1 - Striped Integer 12 0
Subscale Smaller scale divisions are marked with little notches when this option is  turned on. Boolean 2 False
Subscale division count Number of divisions per one grid step (valid only for subscale) Integer 3 10
Wide framing Wide frame is drawn along the edges of the 3DBase when this option is turned on. Boolean 3 False
Subscale color Color of the subscale (valid only for subscale). Query IKCContext2 from IKCContext to access Color 2 rgba=(0.0, 0.0, 0.0, 1)
First stripe color Valid only for color style of type "1". Query IKCContext2 from IKCContext to access Color 4 rgba=(1.0, 1.0, 1.0, 1)
Second stripe color Valid only for color style of type "1". Query IKCContext2 from IKCContext to access Color 5 rgba=(0.0, 1.0, 0.0, 1)

 

See also: DIView sample