70001416 Grid in WebControl

Article 70001416
Type Wish
Product WebJS
Version 7016
Date Added 10/12/2018
Fixed 8.8001.0.1 (10/23/2018)
Submitted by Brendan Fry


I would like to implement Grid in WebControl


In version 8001.0.1 new properties were exported in order to support grid and snap in WebControl.

vdrawobj.GetActiveLayout().GridMode //true -or- false display or not the grid
vdrawobj.GetActiveLayout().GridStyle //one of the following:

vdConst.GridStyle_Dot = 0;
vdConst.GridStyle_Cross = 1;
vdConst.GridStyle_Solid = 2;

vdrawobj.GetActiveLayout().Limits //an array of doubles [xmin,ymin,zmin,xmax,ymax,zmax] in world coordinate system
vdrawobj.GetActiveLayout().GridSpaceX //a number in drawing units
vdrawobj.GetActiveLayout().GridSpaceY //a number in drawing units

vdrawobj.GetActiveLayout().SnapMode// true or false if the cursor will snap (works only if vdrawobj.canvas,style.cursor = "none";
vdrawobj.GetActiveLayout().SnapSpaceX //a number in drawing units
vdrawobj.GetActiveLayout().SnapSpaceY //a number in drawing units
vdrawobj.GetActiveLayout().SnapBase //a point in world coordinate system
vdrawobj.GetDocument().GlobalRenderProperties.GridColor = [255, 99, 71, 255]; //set the R,G,B,A color of grid

Send comments on this topic.