Skip to content

Latest commit

 

History

History
88 lines (73 loc) · 2.43 KB

File metadata and controls

88 lines (73 loc) · 2.43 KB

BeginSym

Description

Procedure BeginSym creates a new symbol definition in a VectorWorks document.

Any objects created after a call to BeginSym will be included in the symbol definition. A call to EndSym will complete the creation of the symbol, which is then generated in the VectorWorks document.

PROCEDURE BeginSym(symbolName : STRING);
def vs.BeginSym(symbolName):
    return None

Parameters

Name Type Description
symbolName STRING Name of the new symbol.

Remarks

Note: normally SetOriginAbsolute(0,0) should be called before calling this. The user origin is used as the insertion point for the symbol, but it may be out of bounds, in which case the symbol is still created but the center of the document is used instead for the insertion point.

BeginSym deselects all objects on the active layer (VW 13, 83388). Be aware of your handles created after that.

Examples

VectorScript

BeginSym('Window');
Rect(-5'-11",-1",-2'-0",-5'-11");
Rect(-5'-8 3/4",-2 1/4",-2'-2 1/4",-2'-10");
Rect(-5'-8 3/4",-3'-1 3/4",-2'-2 1/4",-5'-9");
Rect(-4'-7",-2'-7 3/4",-3'-3 1/2",-2'-9 1/2");
MoveTo(-5'-11",-3'-0");
LineTo(-2'-0",-3'-0");
EndSym;

Python

vs.BeginSym('WindowNew')
vs.Rect(-5*12 -11,-1*12,-2*12,-5*12 -11)
vs.Rect(-5*12 -8 - 3/4,-2*12 + 1/4,-2*12 -2 - 1/4,-2*12 -10)
vs.Rect(-5*12 -8 - 3/4,-3*12 - 1 - 3/4,-2*12 -2 - 1/4,-5*12 - 9)
vs.Rect(-4*12 -7,-2*12 -7 - 3/4,-3*12 - 3 - 1/2,-2*12 - 9 - 1/2)
vs.MoveTo(-5*12 - 11,-3*12)
vs.LineTo(-2*12,-3*12)
vs.EndSym()
BEGIN
	BeginSym(SymName);
	ClosePoly;
		BeginPoly;
			MoveTo(-8.54167e-1',-1.04167e-1');
			LineTo(-7.1875e-1',-1.04167e-1');

IF kDebugMode THEN alrtdialog( concat('sub MakeSymbol === Begin Sym ', SymName ) );
BeginSym(SymName);
SetSelect(h);
Duplicate(-xLoc, -yLoc);
EndSym;
DelObj(h);

BEGIN
	{the handicap symbol definition is missing in the default folder - we create an empty rectangle with the same size}
	BeginSym(GetStr5(1));
		Rect(0 - 20.35", 0 + 24", 0 + 20.35", 0 - 24"); {this the default size for the handicap symbol }
		h := LNewObj;
	EndSym;
END;
import vs

# Procedure BeginSym creates a new symbol definition in a VectorWorks document.
symbolName = 'MySymbol'

vs.BeginSym(symbolName)
newObj = vs.LNewObj()  # handle to the newly created object

Version

Availability: from All Versions

Category