Hello,
I am glad that I can see some evolution in my skills.
And thanks to this forum I can manage more tedious work easy and nice.
In reward here is the first really useful script in vectorscript.
It creates some layers all together with date and different text. I hope you enjoy.
Notes:
-If the layer exist give back an alert and do not create the layer.
{///////////////////////////////////////////
CreateDifferentNewLayers V 1.3
with extra separation layer with date
By Ing. Victor Garzon (2018) distribute freely
avictorgm@gmail.com
Using as codebase from Vectorworks:
(c) 2001 Nemetschek North America. Distribute freely.
///////////////////////////////////////////}
PROCEDURE CreateDifferentNewLayers;
VAR
newname : STRING;
Rahmen : STRING;
LayA : STRING;
LayZERO : STRING;
LayB : STRING;
LayC : STRING;
LayD : STRING;
LayE : STRING;
LayF : STRING;
LayG : STRING;
LayH : STRING;
TextoAlert :STRING;
Texto1 :STRING;
Texto2 :STRING;
ch : HANDLE;
BEGIN
Texto1:= 'The Layer for the Stand ';
Texto2:= ' will be created at the top of the list';
newname:= StrDialog('Enter name of new layer:','Untitled Layer');
LayZERO:= Concat('-------', newname, Date(2,1), '--------------------');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayZERO);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayZERO, Texto2);
Layer(LayZERO)
END
ELSE
AlrtDialog('Layer Layers created already exists.');
LayH:= Concat(newname, '_8_Frei');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayH);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayH, Texto2);
Layer(LayH)
END
ELSE
AlrtDialog('Layer name already exists.');
LayG:= Concat(newname, '_7_Standfläche');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayG);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayG, Texto2);
Layer(LayG)
END
ELSE
AlrtDialog('Layer name already exists.');
LayF:= Concat(newname, '_6_Traversen');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayF);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayF, Texto2);
Layer(LayF)
END
ELSE
AlrtDialog('Layer name already exists.');
LayD:= Concat(newname, '_5_Lasten');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayD);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayD, Texto2);
Layer(LayD)
END
ELSE
AlrtDialog('Layer name already exists.');
LayE:= Concat(newname, '_4_Punkte');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayE);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayE, Texto2);
Layer(LayE)
END
ELSE
AlrtDialog('Layer name already exists.');
LayA:= Concat(newname, '_3_Maße_Lasten');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayA);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayA, Texto2);
Layer(LayA)
END
ELSE
AlrtDialog('Layer name already exists.');
LayB:= Concat(newname, '_2_Maße_Punkte');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayB);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayB, Texto2);
Layer(LayB)
END
ELSE
AlrtDialog('Layer name already exists.');
LayC:= Concat(newname, '_1_Maße_Träger');
IF NOT DidCancel THEN BEGIN
ch:= GetObject(LayC);
IF (ch = NIL) THEN
TextoAlert:= Concat(Texto1, LayC, Texto2);
Layer(LayC)
END
ELSE
AlrtDialog('Layer name already exists.');
END;
Run(CreateDifferentNewLayers);