Angle2Str Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Angle2Str
( value:REAL ) :STRING ;

Python:

def  vs.Angle2Str(value):
   return STRING

Description:

Convert an angle value from a real number to a string using the current document formatting.

Parameters:

value The angle value.



  Area2Str Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Area2Str
( value:REAL ) :STRING ;

Python:

def  vs.Area2Str(value):
   return STRING

Description:

Convert an area value from a real number to a string using the current document formatting.

Parameters:

value The area value.



  Chr Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Chr
( v:INTEGER ) :CHAR ;

Python:

def  vs.Chr(v):
   return CHAR

Description:

Function Chr returns the ASCII character corresponding to the specified numeric code. The ASCII code value must be between 1 and 255.

Parameters:

v ASCII numeric identifier code.

Example:

PROCEDURE Example;
VAR
	cnt :INTEGER;
	str :STRING;
BEGIN
	FOR cnt := 128 TO 255 DO BEGIN
		str := Concat(str, Chr(cnt));
		IF cnt MOD 32 = 0 THEN str := Concat(str, Chr(13));
	END;
	AlrtDialog(str);
END;
RUN(Example);

See Also:

Ord  



  Concat Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Concat
(   txt :DYNARRAY[] of CHAR
) :DYNARRAY[] of CHAR ;

Python:

def  vs.Concat(txt):
   return DYNARRAY of CHAR

Description:

Function Concat combines, or concatenates, all the specified parameters in order and returns the resultant string.

Example:

newStr:=Concat('A','sample','string');



  Copy Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Copy
(   source :DYNARRAY[] of CHAR;
    index :INTEGER;
    count :INTEGER
) :DYNARRAY[] of CHAR ;

Python:

def  vs.Copy(source, index, count):
   return DYNARRAY of CHAR

Description:

Function Copy returns a substring from a specified source string.

Parameters:

source Source string.
index Start position in text string.
count Length of substring.

Example:

newStr:=Copy('A sample string',10,6);
{returns 'string'}



  Delete Strings 
MiniCAD

VectorScript Declaration:

PROCEDURE   Delete
( VAR  source :DYNARRAY[] of CHAR;
    index :INTEGER;
    count :INTEGER
) ;

Python:

def  vs.Delete(source, index, count):
   return source

Description:

Procedure Delete removes a substring from the specified source string.

Parameters:

source Source string.
index Start position in text string.
count Length of substring.

Example:

theStr:='A sample string';
Delete(theStr,3,7);
{deletes 'sample' from the string value}



  GetResourceString Strings 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   GetResourceString
( VAR  theString :STRING;
    id :INTEGER;
    index :INTEGER
) ;

Python:

def  vs.GetResourceString(id, index):
   return theString

Description:

Returns the specified resource string from a resource file.

Parameters:

theString The string contained within the resource.
id The ID of the resource.
index The index of the string resource.

See Also:

SetVSResourceFile  



  GetVWRString Strings 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   GetVWRString
( VAR  outputString :STRING;
    resIdentifier :STRING;
    stringIdentifier :STRING
) ;

Python:

def  vs.GetVWRString(resIdentifier, stringIdentifier):
   return outputString

Description:

Replaces GetResourceString -- load a string from VWR file

Parameters:

outputString result value
resIdentifier VWR identifier and path to vwstrings file
stringIdentifier key in vwstrings file



  Insert Strings 
MiniCAD

VectorScript Declaration:

PROCEDURE   Insert
(   source :DYNARRAY[] of CHAR;
  VAR  dest :DYNARRAY[] of CHAR;
    index :INTEGER
) ;

Python:

def  vs.Insert(source, index):
   return dest

Description:

Procedure Insert will insert the specified string into a destination string.

Parameters:

source String to be inserted.
dest Destination string.
index Position where string is to be inserted.

Example:

theStr:='sample';
originalStr:='A string';
Insert(theStr,originalStr,3);
{inserts 'sample' into the target string}



  Len Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Len
( v:DYNARRAY[] of CHAR ) :INTEGER ;

Python:

def  vs.Len(v):
   return INTEGER

Description:

Function Len returns the length of the specified string value.

Parameters:

v Source string.



  Num2Str Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Num2Str
(   decPlace :INTEGER;
    v :REAL
) :STRING ;

Python:

def  vs.Num2Str(decPlace, v):
   return STRING

Description:

Function Num2Str converts a REAL value to a string and returns the value.

Parameter decPlace has a range of -1 to 10; if -1 is specified, the value will be returned in scientific notation.

Parameters:

decPlace Number of decimal places.
v Numeric value.

Example:

oldnumValue:=232.5148;
newStrValue:=Num2Str(3,oldnumValue);
{would return '232.515'}



  Num2StrF Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Num2StrF
( vDistance:REAL (Coordinate) ) :STRING ;

Python:

def  vs.Num2StrF(vDistance):
   return STRING

Description:

Function Num2StrF converts a specified REAL value into a string. The numeric value will be converted and displayed in the current unit settings of the drawing.


Parameters:

vDistance Numeric value.

Example:

oldnumValue:=23.45;
newStrValue:=Num2StrF(oldnumValue);
{would return 1'-11 1/2"}



  Ord Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Ord
( v:CHAR ) :INTEGER ;

Python:

def  vs.Ord(v):
   return INTEGER

Description:

Function Ord returns the corresponding ASCII number of the specified character value. Parameter Ord specifies the character.

Parameters:

v ASCII character.

Example:

PROCEDURE Main;
VAR
	str :STRING;
	cnt :INTEGER;
BEGIN
	str := GetText(FSActLayer);
	FOR cnt := 1 TO Len(str) DO
		AlrtDialog(Concat(Ord(Copy(str, cnt, 1))));
END;
RUN(Main);

See Also:

Chr  



  Pos Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Pos
(   subStr :DYNARRAY[] of CHAR;
    str :DYNARRAY[] of CHAR
) :INTEGER ;

Python:

def  vs.Pos(subStr, str):
   return INTEGER

Description:

Function Pos searches for a specified substring contained within in a target string.

Pos returns the position of the substring. If the string is not found, 0 is returned.

Parameters:

subStr Substring to be located.
str Target string.

Example:

Loc:=Pos('samp','A sample string');



  Str2Angle Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Str2Angle
( str:STRING ) :REAL ;

Python:

def  vs.Str2Angle(str):
   return REAL

Description:

Convert a string representation of an angle value to a real number.

Parameters:

str The string representation of the angle value.



  Str2Area Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Str2Area
( str:STRING ) :REAL ;

Python:

def  vs.Str2Area(str):
   return REAL

Description:

Convert a string representation of an area value to a real number.

Parameters:

str The string representation of the area value.



  Str2Num Strings 
MiniCAD

VectorScript Declaration:

FUNCTION   Str2Num
( s:STRING ) :REAL ;

Python:

def  vs.Str2Num(s):
   return REAL

Description:

Function Str2Num returns the specified string as a numeric value.

Parameters:

s Source string.

Example:

numValue:=Str2Num('235.44');

See Also:

ValidNumStr  



  Str2Volume Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Str2Volume
( str:STRING ) :REAL ;

Python:

def  vs.Str2Volume(str):
   return REAL

Description:

Convert a string representation of a volume value to a real number.

Parameters:

str The string representation of the angle value.



  StringAnsiToMac Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   StringAnsiToMac
( string:STRING ) :STRING ;

Python:

def  vs.StringAnsiToMac(string):
   return STRING

Description:

Converts an ANSI encoded string into a Mac encoded string.



  StringMacToAnsi Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   StringMacToAnsi
( string:STRING ) :STRING ;

Python:

def  vs.StringMacToAnsi(string):
   return STRING

Description:

Converts a Mac encoded string into an ANSI encoded string.



  SubString Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   SubString
(   text :DYNARRAY[] of CHAR;
    delimiter :STRING;
    index :INTEGER
) :DYNARRAY[] of CHAR ;

Python:

def  vs.SubString(text, delimiter, index):
   return DYNARRAY of CHAR

Description:

Function SubString splits the Text string using characters specified in the Delemiters and returns the token located at the Index position.
The first token is located at index 1.
If there is an error the function returns ''(empty string).
If index is less than 1 or grater than max number of tokens the function returns ''(empty string).

Example:

middleStr:=SubString('Left;Middle;Right',';',2);



  UprString Strings 
MiniCAD

VectorScript Declaration:

PROCEDURE   UprString
VAR str:DYNARRAY[] of CHAR ) ;

Python:

def  vs.UprString(str):
   return str

Description:

Procedure UprString converts all characters in the specified string to upper case.

Parameters:

str Source string.

Example:

revisedString := 'vectorworks';
UprString(revisedString);
{Sets revisedString equal to 'VECTORWORKS'}



  Volume2Str Strings 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Volume2Str
( value:REAL ) :STRING ;

Python:

def  vs.Volume2Str(value):
   return STRING

Description:

Convert a volume value from a real number to a string using the current document formatting.

Parameters:

value The volume value.