Prod.: Engine, ver.: 6019, ID: 60001291, Wish : New custom grid display style

Wish : New custom grid display style

Article60001291
TypeWish
ProductEngine
Version6019
Date Added1/19/2011
FixedYes [2/3/2011]
Submitted byGraham Parker
Keywords

Subject

New custom grid display style

Summary

We would like a Custom Grid style to be displayed where the X value of Vertical Grid Lines is displayed at the top of each line and the Y value of Horizontal Grid Lines is displayed at the Right side

Extra properties for the following would have to be set:

Text Size and Colour

Whether to Display X Grid Values on Top, Bottom, None or Both

Whether to Display Y Grid Values on Left, Right, None or Both

Obviously as lines get compressed down when zooming out, the text will only be displayed on every alternate  lines based on the text size chosen.


 

Solution



Implemented in version 6020

A new property GridMeasure  was added in vdLayout and vdViewport objects.

This value is defines a Grid that fills entire screen with horizontal and vertical lines with their X and Y coordinate values in current User Coordinate System



This property is a VectorDraw.Professional.vdObjects.GridMeasured object type



This object contains the following properties:

Visible                    //Get/Set a value that represents if the grid is visible.Default value is False.

ViewOnlyInUCS    //Get/Set a value that represents if the grid will be displayed on View planes other than Current User Co-ordinate system.Default value is False.

DrawBefore          // Get/Set a value that represents if the grid will be drawn before or after basic entities rendering.Default value is True.

Placement           // Get/Set a value that represents the sides where the x and y coordinates will be drawn.Default value is LeftBottom

GridColor             //Get/Set the color used to draw the grid.Default value null and the Palette Forground is used.

LineWeight          // Get/Set The LineWeight for the grid lines.Default value VdConstLineWeight.LW_0

AlphaBlending    // Get/Set the AlphaBlending value for the selected GridColor.Default value is 255.No AlphaBlending.

DisplayText         // Get/Set a value that represents if the X and Y text values will be dispalyed.Default value is True.

TextStyle             // Get/Set the selected textstyle used to draw the Cordinate string values on the sides of grid.Default value is the vdDocument.ActiveTextStyle

TextColor            // Get/Set the vdColor object that the texts will be drawn with. Default value null and the Palette Foreground is used.

TextSize              //Get/Set the height in device milimeters that all texts of the grid will be use.Default value is 3 milimeters

TextGap              //Get/Set the gap in device milimeters between text and grid lines.

NumericFormat            //Default value is an empty string and used the default VectorDraw string format implementation.

                                // It can get values like "0.#" or "F3" or "#.#" or "###,###,###0.#" etc. see Standard Numeric Format Strings and Custom Numeric Format Strings of .NET MSDN

MinGridLineDistance            //Get/Set the minimun distance between horizontal or vertical grid lines in device milimeters.

LockGridLineDistance          //Lock the grid line distance with the specified value in Drawing Units.

                                       // Set it to 0.0 in order the <see cref="MinGridLineDistance"/> in millimeters to be used.

                                       // Set it to a negative value in order the current view grid line distance in drawing units to be used.

                                       // Default value is 0.0

Methods:

SetMeasuredSpaceParameters Controls the spaces between grid lines depend on each zoom and TextSize property.


 

Example:

document.Model.GridMeasure.Visible = true;

//Controls the spaces between grid lines depend on each zoom and TextSize property.

//First parameter is an array of doubles with minimun values of spaces between vertical and horizodal grid lines  in drawing units

//Second parameter is the multiplier that is used to increase the spcaes if the Text on line grids are not fit properly.

document.Model.GridMeasure.SetMeasuredSpaceParameters (new double[]{0.1,0.25,0.5},10.0d);


document.Model.GridMeasure.LineWeight              = VdConstLineWeight.LW_100;

document.Model.GridMeasure.AlphaBlending          = 128;

document.Model.GridMeasure.TextColor          = new vdColor(Color.Blue);

document.Model.GridMeasure.Placement        = VectorDraw.Professional.vdObjects.GridMeasured .GridMeasuredValuesPlacementFlag.RightTop

document.Redraw(true);