| Article | 70002787 |
| Type | HowTo |
| Product | WebJS |
| Date Added | 11/13/2025 12:00:00 AM |
| Fixed | 11.5.2 (11/13/2025 12:00:00 AM) |
| Submitted by | Brendan Fry |
Summary
HowTo hide or show the arrow heads of a dimension line in the vdwebcontrol
Solution
You must create a block with its entities in a specific Layer
And show / hide the arrow by change the Frozen property of the Layer
Example
Toogle show/Hide the arrow eads of a dimension line
var arrowblocklayer = vdcanvas.FindLayer('dimarrow');
if (arrowblocklayer) {
arrowblocklayer.Frozen = !arrowblocklayer.Frozen;
setTimeout(vdcanvas.redraw);
} else {
arrowblocklayer = vdcanvas.AddLayer('dimarrow');
var blk = vdcanvas.AddBlock("dimblck1");
var hp = vdcanvas.GetActiveHatchProperties();
vdcanvas.SetActiveHatchProperties(vdcanvas.createNewHatchProperties('solid'));
var pl = vdcanvas.AddPolyline([[0, 0], [-2.0, -0.4], [-2.0, 0.4], [0, 0]], false, blk.Entities);
pl.Layer = 'h_' + arrowblocklayer.HandleId.toString();
vdcanvas.UpdateFig(pl);
vdcanvas.SetActiveHatchProperties(hp);
//create a new dimension manager that holds the dimension properties
var dimstyle = new vddimmanager(); //create the object
dimstyle.BLK = 'dimblck1';
//create a dimension using the above dimension manager properties
var dim = dimstyle.Create(vdcanvas, [-3, -2, 0], [3, -2, 0], [0, 0, 0]); //the dimension will be added in the entities of the layout
vdcanvas.DrawEntity(dim); //draw the new object on the canvas
vdcanvas.Refresh(); //refresh the canvas element in order to see the result.
}
