%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
doubleline Method
See Also  Example
vdWebLibrary Namespace > ScriptCommands Class : doubleline Method
parameters
An array that contains the VertexList of the doubleLine polyline.For example it can be [[1,1,0],[2,2,0],[2,0,0]]
closed
Set it to true in order to draw a closed doubleLine polyline
splineflag
Defines the SplineFlag for the doubleLine polyline.Valid values are SplineFlagSTANDARD or SplineFlagFITTING or SplineFlagCONTROLPOINTS or SplineFlagQUADRATIC
callback
A user function of ScriptEntityDelegate type, that will be called when the command finish successfully.It can be ignored.
Add a doubleLine polyline to the document.

Syntax

JScript 
public function doubleline( 
   parameters : Object[],
   closed : boolean,
   splineflag : int,
   callback : ScriptEntityDelegate
);

Parameters

parameters
An array that contains the VertexList of the doubleLine polyline.For example it can be [[1,1,0],[2,2,0],[2,0,0]]
closed
Set it to true in order to draw a closed doubleLine polyline
splineflag
Defines the SplineFlag for the doubleLine polyline.Valid values are SplineFlagSTANDARD or SplineFlagFITTING or SplineFlagCONTROLPOINTS or SplineFlagQUADRATIC
callback
A user function of ScriptEntityDelegate type, that will be called when the command finish successfully.It can be ignored.

Example

C#Copy Code
vdrawobj.scriptCommand.doubleline(); // begins a user action draw of a doubleline polyline
C#Copy Code
vdrawobj.scriptCommand.doubleline(null,true,1); // begins a user action draw of a closed fitting spline doubleline
C#Copy Code
// draw a doubleline polyline using active color , linetype,layer etc properties, from 1,1 to 2,2 to 2,0 
//after this command is finished the object is not drawn on screen. 
//You can call the vdrawObj.redraw after adding an amount of commands 
vdrawobj.scriptCommand.doubleline([[1,1,0],[2,2,0],[2,0,0]],true,0);  
setTimeout(vdrawObj.redraw);//post a redraw command

Remarks

if passed parameters not exist or it is null then start a new user action and prompts the user to draw a doubleLine polyline. If parameters are not null then a new polyline is added synchronously depend on the passed parameters. The command add the action to undo history and also to script lines getCommands If parameters are not null and after this command is finished the object is not drawn on screen In order to display it call DrawEntity and Refresh inside the user define callback .See example.

See Also