%%PageItemTitle%%

VectorDraw Web Library

JsPropertiesExtractor Send comments on this topic.
parse Method
See Also  Example
vdWebLibrary Namespace > BaseActionObj Class : parse Method
parseString

Parses the passed command string

For example user can pass a text input from a textbox in the following form

1. x,y,z coordinate values

separate values by ',' symbol

vdcanvas.ActiveAction().parse('5.5,2.1,0.5');

2. distance < angle polar values

distance is a double value in drawing units

angle is a double value in degrees

separate values by '<' symbol

vdcanvas.ActiveAction().parse('7.8 < 45.0');

3. Xoffset,Yoffset relative values

vdcanvas.ActiveAction().parse('@2.5,3.7');

NOTE: A prefix '@' is needed

Syntax

JScript 
public function parse( 
   parseString : String
);

Parameters

parseString

Example

We create a textbox and a button which fires the parseString() function which parses the string from the textbox and run the vdrawObj.ActiveAction().parse(str).
C#Copy Code
function parseString() { 
    var str = document.getElementById('parseStr').value; 
    vdcanvas.ActiveAction().parse(str); 
}

See Also