70001934 Have an option to fill or not double lines and polyline widths

Article 70001934
Type Wish
Product WebJS
Version 8006
Date Added 3/5/2021 12:00:00 AM
Fixed 9.9001.0.4 (3/6/2021 12:00:00 AM)
Submitted by Bogumil Styczen

Summary

Have an option to fill or not double lines and polyline widths

Solution

New property PLineDrawFlag of vdPolyline and vdDocument was added in version 9001.0.4 for both VDF and web control components
It can be on of the following

Default : uses the vdDocument.PLineDrawFlag
SolidWidths : The widths are drawn as Solid fill
WireWidths: The widths are not filled

javascript example:

//create doubleline and display it with solid filled widths
vdcanvas.GetDocument().PLineDrawFlag = vdConst.PLineDrawFlags_SolidWidths;
vdcanvas.scriptCommand.doublelinewidth(0.5);
vdcanvas.scriptCommand.doubleline(null, true, vdConst.SplineFlagSTANDARD);

//create doubleline and display it with-out filled widths
vdcanvas.GetDocument().PLineDrawFlag = vdConst.PLineDrawFlags_WireWidths;
vdcanvas.scriptCommand.doublelinewidth(0.5);
vdcanvas.scriptCommand.doubleline(null, true, vdConst.SplineFlagSTANDARD);

NOTE: All the above examples display doubleline withs according to the vdDocument.PLineDrawFlag value
if you want to force a created doubleline to be display as  with-out filled widths independently of the vddocument PLineDrawFlag , you can use the following code
         vdcanvas.GetDocument().PLineDrawFlag = vdConst.PLineDrawFlags_WireWidths; //temporary change document PLineDrawFlag to wire mode
         vdcanvas.scriptCommand.doublelinewidth(0.5);
         vdcanvas.scriptCommand.doubleline(null, true, vdConst.SplineFlagSTANDARD, doublelinefinished);
         function doublelinefinished(vd, figure) {
            if (figure)
                figure.PLineDrawFlag = vdConst.PLineDrawFlags_WireWidths;
            vd.GetDocument().PLineDrawFlag = vdConst.PLineDrawFlags_Default; //restore document PLineDrawFlag
        }


VDF C# components are also support vdPolyline.PLineDrawFlag and vdDocument.PLineDrawFlag

Send comments on this topic.