70001171 Draw new temporary entities over all drawing entities

Article 70001171
Type Wish
Product WebJS
Version 7011
Date Added 9/26/2017
Fixed 7.7012.0.7 (9/26/2017)
Submitted by Ilan Sandor

Summary

Draw a collection of entities that are not added to document after all document entities was drawn. Those entities need to be updated and display with a single vdcanvas.Refresh without need to redraw the entire drawing.

Solution

A new property DrawOverallEntities of vdcanavs was added in version 7012.0.7
By default is undefined.
User can add new entities to vdcanavs.DrawOverallEntities collection, that are not added to selected document
Those entities are drawn during a Refresh and after all document entities drawing.

NOTE:DrawOverallEntities are not called when printing using the vdcanvas.printToImageData
Depth and selection are disabled for these objects

Example:
var rect = vdcanvas.AddRect([0,0,0], [1,1,0], false, {});// create a new that is not added to selected document entities( last parameter present and is an empty object {})
rect .HatchProperties = vdcanvas.createNewHatchProperties(vdConst.FillModeSolid, vdConst.colorFromString('byblock'), vdConst.colorFromString('255,0,0'));
if(!vdcanavs.DrawOverallEntities) vdcanavs.DrawOverallEntities = [];//initialize to an empy array if is undefined
vdcanavs.DrawOverallEntities.push(rect );
vdcanavs.Refresh();//in order to display the new overall entities.

After that the entities will be dispalyed in any redraw.
Set the vdcanavs.DrawOverallEntities to null in order not to display overall entities.

Send comments on this topic.