VS:CreateText

From Vectorworks Developer
Revision as of 14:25, 12 August 2013 by Root (talk | contribs) (1 revision)
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Procedure CreateText creates a new text object in a VectorWorks document. The text object is created using the current pen position and default attributes.

PROCEDURE CreateText(
theText :DYNARRAY[] of CHAR);
def vs.CreateText(theText):
    return None

Parameters

theText DYNARRAY[] of CHAR Text string.

Example

VectorScript

PROCEDURE Example;
VAR
Txt   :ARRAY [1..100] of STRING;
Outpt :DYNARRAY[] of CHAR;
i     :INTEGER;
BEGIN
FOR i := 1 TO 5 DO txt[i] := 'asdf';
i := 2;
Outpt := Txt[1];
WHILE Txt[i] <> '' DO BEGIN
OutPt := Concat(Outpt, Chr(13), Txt[i]);
i := i + 1;
END;
Layer('Text');
CreateText(Outpt);
Layer('Layer-1');
END;
RUN(Example);

Python

def Example():
	txt = []
	for i in range(0,4):
		txt.append('asdf')
	txt.append("")
	i = 1
	Outpt = txt[0]
	while txt[i] != "":
		OutPt = vs.Concat(Outpt, vs.Chr(13), txt[i])
		i = i + 1
		
	vs.Layer('Text')
	vs.CreateText(Outpt)
	vs.Layer('Layer-1')

Example()

Version

Availability: from VectorWorks8.0

See Also

VS Functions:

VS:BeginText | VS:EndText

VS Functions:

[[VS:BeginText]]

| [[VS:EndText]]