Article | 70001906 |
Type | Wish |
Product | WebJS |
Version | 8006 |
Date Added | 1/26/2021 12:00:00 AM |
Fixed | 9.9001.0.2 (1/27/2021 12:00:00 AM) |
Submitted by | Bogumil Styczen |
Summary
I would like to be able to add an Infinity Line through WebControl.
Solution
In version 9001.0.2 three new mothed have been exported which give to the user the ability to create and add Xline and Ray line through WebControl.
On scriptCommands we have the scriptCommand.xline(object[] parameters, ScriptEntityDelegate callback) and the scriptCommand.ray(object[] parameters, ScriptEntityDelegate callback) methods and
on vdraw object we have the vdrawObj.AddInfinityLine(int infinitytype, object basepoint, object direction, bool drawit, object entities).
Example 1: Add a new X Line with basepont[0,0,0] and direction[1,0,0] with sctiptCommand.
function actionentityaddedXline(vdraw, entity) { vdraw.DrawEntity(entity); setTimeout(vdraw.Refresh);//post a refresh command } vdcanvas.scriptCommand.xline([[0, 0, 0], [1, 0, 0]], actionentityaddedXline);Example 2: Add a new Ray Line with basepont[0,0,0] and direction[0,1,0] with sctiptCommand.
function actionentityaddedRay(vdraw, entity) { vdraw.DrawEntity(entity); setTimeout(vdraw.Refresh);//post a refresh command } vdcanvas.scriptCommand.xline([[0, 0, 0], [0, 1, 0]], actionentityaddedRay);Example 3: Add a new X Line with basepoint [0,0,0] and direction [1,0,0] with vdrawObj.
vdcanvas.AddInfinityLine(vdConst.InfinityTypes_XLine, [0, 0, 0], [1, 0, 0], true);Example 4: Add a new Ray Line with basepoint [0,0,0] and direction [0,1,0] with vdrawObj.
vdcanvas.AddInfinityLine(vdConst.InfinityTypes_Ray, [0, 0, 0], [0, 1, 0], true);