Add2DVertex Objects - Polys 
Vectorworks 2012

VectorScript Declaration:

PROCEDURE   Add2DVertex
(   pX :REAL;
    pY :REAL;
    vertexType :INTEGER;
    arcRadius :REAL (Coordinate)
) ;

Python:

def  vs.Add2DVertex(p, vertexType, arcRadius):
   return None

Description:

This procedure will add to a polyline a vertex defined by its position, its type(0 to 4) and the radius if type is 3 or 4. A vertex of type 4 should be followed and preceded by corner vertices. If the type is equal to 4, the point will be a middle point of an arc. In this case if the radius is not given (0) it will be computed.

Parameters:

p The vertex to add to a polyline.
vertexType The type of the vertex it could be 0, 1, 2, 3 or 4.
arcRadius The arc radius if the vertex type is 3 or 4.

Example:

beginPoly;
Add2DVertex(0,0,0,0);
Add2DVertex(1,1,4,0);
Add2DVertex(2,0,0,0);
Add2DVertex(3,1,4,0);
Add2DVertex(4,0,0,0);
endPoly;



  AddPoint Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   AddPoint
(   pX :REAL;
    pY :REAL
) ;

Python:

def  vs.AddPoint(p):
   return None

Description:

Procedure AddPoint adds a vertex point to a newly created polygon. AddPoint is designed to be used with BeginPoly and EndPoly to define new polygon objects via VectorScript.

Parameters:

p Coordinates of vertex.

Example:

BeginPoly;
     AddPoint(0,0);
     AddPoint(2,0);
     AddPoint(2,2);
     AddPoint(1,3);
     AddPoint(0,2);
     AddPoint(0,0);
EndPoly;
{creates a polygon object}

BeginPoly;
     AddPoint(x,y);
     x := x + 1;
     y := y + 1;
     AddPoint(x,y);
     x:= x + 1;
     y := y - 1;
     AddPoint(x,y);
EndPoly;
{creates a polygon with vertices as calculated}



  ArcTo Objects - Polys 
MiniCAD4.0

VectorScript Declaration:

PROCEDURE   ArcTo
(   pX :REAL;
    pY :REAL;
    radiusDistance :REAL (Coordinate)
) ;

Python:

def  vs.ArcTo(p, radiusDistance):
   return None

Description:

Procedure ArcTo creates an arc vertex with a point of intersection at the specified coordinate point.

The endpoints of the arc are tangent to the control segments which intersect at p. If a radius of 0 is passed as the parameter, the arc endpoints will be at the vertices preceding and following the arc spline vertex.

Parameters:

p Coordinates of vertex.
radiusDistance Radius of vertex arc.

Example:

BeginPoly;
   LineTo(-1",2");
   LineTo(-2 1/2",1/2");
   CurveTo(-1 1/2",-1 1/2");
   LineTo(1",-1/2");
   ArcTo(1",1 1/2",1/2");
EndPoly;
{creates a polyline object}



  BeginPoly Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   BeginPoly
;

Python:

def  vs.BeginPoly():
   return None

Description:

Procedures BeginPoly creates a new polygon or polyline object in a Vectorworks document. When used with vertex creation procedure calls, BeginPoly and EndPoly() define the polygon object on a vertex by vertex basis.

A minimum of two vertices must be created, and calculations may be performed within the creation structure between vertex calls, thus allowing additional flexibility in object generation.Hidden edges may be created by using use MoveTo() or Move() between vertex calls.

Example:






  ClosePoly Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   ClosePoly
;

Python:

def  vs.ClosePoly():
   return None

Description:

Procedures ClosePoly set the polygon creation mode for polygon objects created in VectorScript to closed. To turn this mode off, use Procedure OpenPoly; the two modes used in conjunction will act as a toggle for the feature.

Example:

ClosePoly;
Poly(0,0,1,1,1,-1);
{creates a closed 3 sided polygon}



  CurveThrough Objects - Polys 
MiniCAD4.0

VectorScript Declaration:

PROCEDURE   CurveThrough
(   pX :REAL;
    pY :REAL
) ;

Python:

def  vs.CurveThrough(p):
   return None

Description:

Procedure CurveThrough fits a cubic spline through the specified point.

Parameters:

p Coordinates of vertex.



  CurveTo Objects - Polys 
MiniCAD4.0

VectorScript Declaration:

PROCEDURE   CurveTo
(   pX :REAL;
    pY :REAL
) ;

Python:

def  vs.CurveTo(p):
   return None

Description:

Procedure CurveTo creates a bezier vertex point at the specified point. Parameter p specifies the coordinate location of the vertex.

Parameters:

p Coordinate of vertex.



  DelVertex Objects - Polys 
MiniCAD6.0

VectorScript Declaration:

PROCEDURE   DelVertex
(   objectHd :HANDLE;
    vertexNum :INTEGER
) ;

Python:

def  vs.DelVertex(objectHd, vertexNum):
   return None

Description:

Procedure DelVertex deletes a vertex from the referenced object. Parameter vertexNum specifies the vertex to be deleted.

Parameters:

objectHd Handle to polygon.
vertexNum Index of vertex to be deleted.



  EndPoly Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   EndPoly
;

Python:

def  vs.EndPoly():
   return None

Description:

Procedure EndPoly completes the definition of a polygon or polyline object within a Vectorworks document. On calling EndPoly, the object is created in the document from the preceding vertex creation calls.



  GetHole Objects - Polys 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   GetHole
(   inOutsidePolyline :HANDLE;
    inIndex :INTEGER;
  VAR  outHole :HANDLE
) :BOOLEAN ;

Python:

def  vs.GetHole(inOutsidePolyline, inIndex):
   return (BOOLEAN, outHole)

Description:

Returns a handle to a polyline defining an opening within the referenced polyline.

The definition polyline can be edited or queried using the standard VectorScript polyline API functions.

Parameters:

inOutsidePolyline Handle to polyline.
inIndex Index number of opening definition polyline.
outHole Handle to definition polyline.

Result:

Returns TRUE if the polyline contains openings, otherwise returns FALSE.

Example:

PROCEDURE Example;
VAR
	inPolyline  :HANDLE;
	outNumHoles :INTEGER;
	inIndex     :INTEGER;
	outHole     :HANDLE;
	vertexNum   :INTEGER;
	pX, pY      :REAL;
	vertexType  :INTEGER;
	arcRadius   :REAL;
BEGIN
	inPolyline := FSActLayer;
	IF GetNumHoles(inPolyline, outNumHoles) THEN BEGIN
		FOR inIndex := 1 TO outNumHoles DO BEGIN
			if GetHole(inPolyline, inIndex, outHole) THEN BEGIN
				FOR vertexNum := 1 TO GetVertNum(outHole) DO BEGIN
					GetPolylineVertex(outHole, vertexNum, pX, pY, vertexType, arcRadius);
					WriteLn('pX: ', pX, ' pY: ', pY);
				END;
			END;
		END;
	END;
END;
RUN(Example);

See Also:

GetNumHoles  



  GetNumHoles Objects - Polys 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   GetNumHoles
(   inPolyline :HANDLE;
  VAR  outNumHoles :INTEGER
) :BOOLEAN ;

Python:

def  vs.GetNumHoles(inPolyline):
   return (BOOLEAN, outNumHoles)

Description:

Returns the number of openings in the referenced polyline.

Parameters:

inPolyline Handle to polyline.
outNumHoles The number of openings in the polyline object.

Result:

Returns TRUE if the polyline contains openings, otherwise returns FALSE.

See Also:

GetHole  



  GetPolylineArcMaxRadius Objects - Polys 
Vectorworks 2012

VectorScript Declaration:

FUNCTION   GetPolylineArcMaxRadius
(   hPoly :HANDLE;
    vertexNum :INTEGER
) :REAL ;

Python:

def  vs.GetPolylineArcMaxRadius(hPoly, vertexNum):
   return REAL

Description:

Return a maximum radius of the specified vertex of type arc or radius of a polyline.

Parameters:

hPoly Handle of the poliline
vertexNum Index of vertex to be queried.

Result:

If the vertex type is not arc or radius it returns -1.

See Also:

GetPolylineVertex   SetPolylineVertex  



  GetPolylineVertex Objects - Polys 
VectorWorks8.5

VectorScript Declaration:

PROCEDURE   GetPolylineVertex
(   obj :HANDLE;
    vertexNum :INTEGER;
  VAR  pX :REAL;
  VAR  pY :REAL;
  VAR  vertexType :INTEGER;
  VAR  arcRadius :REAL
) ;

Python:

def  vs.GetPolylineVertex(obj, vertexNum):
   return (p, vertexType, arcRadius)

Description:

Returns information about the specified polyline vertex.

Note that vertexNum is 1-based for Polygons and Polylines, and 0-based for 3D Polylines.

Parameters:

obj Handle to object.
vertexNum Index of vertex to be queried.
p X-Y coordinates of vertex.
vertexType Type of vertex.
arcRadius Radius of vertex corner (arc vertex only).

Example:

PROCEDURE Example;
VAR
	obj        :HANDLE;
	vertexNum  :INTEGER;
	ptX, ptY   :REAL;
	vertexType :INTEGER;
	arcRadius  :REAL;
BEGIN
	obj := FSActLayer;
	FOR vertexNum := 1 TO GetVertNum(obj) DO BEGIN
		GetPolylineVertex(obj, vertexNum, ptX, ptY, vertexType, arcRadius);
		TextOrigin(ptX, ptY);
		CreateText(Concat('vNum: ', vertexNum, '  vType: ', vertexType, '  radius: ', arcRadius));
	END;
END;
RUN(Example);



  GetPolyPt Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   GetPolyPt
(   objectHd :HANDLE;
    index :INTEGER;
  VAR  pX :REAL;
  VAR  pY :REAL
) ;

Python:

def  vs.GetPolyPt(objectHd, index):
   return p

Description:

Procedure GetPolyPt returns the coordinates of a specified vertex of the referenced object.

Parameters:

objectHd Handle to polygon.
index Index of vertex (range of 1 to n).
p Returns coordinates of vertex.

Example:

for i := 1 to GetVertNum(thePoly) do
begin		
	GetPolyPt(thePoly, i, vertX, vertY);
end;	



  GetVertexVisibility Objects - Polys 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetVertexVisibility
(   h :HANDLE;
    vertnum :INTEGER
) :BOOLEAN ;

Python:

def  vs.GetVertexVisibility(h, vertnum):
   return BOOLEAN

Description:

Returns the visibility of the specified vertex of the referenced object.

Parameters:

h Handle to the polygon or polyline
vertnum Index of the vertex (zero-based).

Result:

Returns true if the vertex is visible, false otherwise.

See Also:

SetVertexVisibility  



  GetVertNum Objects - Polys 
MiniCAD

VectorScript Declaration:

FUNCTION   GetVertNum
( PolyHd:HANDLE ) :INTEGER ;

Python:

def  vs.GetVertNum(PolyHd):
   return INTEGER

Description:

Function GetVertNum returns the number of vertices of the referenced polygon or polyline object.

Parameters:

PolyHd Handle to polygon.



  InsertVertex Objects - Polys 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   InsertVertex
(   objectHandle :HANDLE;
    x :REAL;
    y :REAL;
    beforeVertexNum :INTEGER;
    vertexType :INTEGER;
    arcRadius :REAL
) ;

Python:

def  vs.InsertVertex(objectHandle, x, y, beforeVertexNum, vertexType, arcRadius):
   return None

Description:

Inserts a new vertex into polygon or polyline. If the vertexType is nonzero, it will convert the objectHandle into a polyline.

Parameters:

objectHandle Handle to the polygon or polyline
x X-coordinate of the vertex to add
y Y-coordinate of the vertex to add
beforeVertexNum Vertex number before which the new vertex is to be inserted
vertexType Vertex type of the new vertex
arcRadius For arc vertices, the radius of the arc



  IsPolyClosed Objects - Polys 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   IsPolyClosed
( polyHandle:HANDLE ) :BOOLEAN ;

Python:

def  vs.IsPolyClosed(polyHandle):
   return BOOLEAN

Description:

Returns true if the specified polyline or polygon is a closed shape, and false otherwise.



  OpenPoly Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   OpenPoly
;

Python:

def  vs.OpenPoly():
   return None

Description:

Procedures OpenPoly set the polygon creation mode for polygon objects created in VectorScript to open. To turn this mode off, use Procedure ClosePoly; the two modes used in conjunction will act as a toggle for the feature.

Example:

OpenPoly;
Poly(0,0,1,1,1,-1);
{creates a open 3 sided polygon}



  Poly Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   Poly
(   p :REAL
) ;

Python:

def  vs.Poly(p):
   return None

Description:

Procedure Poly creates a polygon object in the document. Vertices of the polygon are specified by a parameter list of x1,y1 through xn,yn, which correspond to the coordinate locations of each vertex.

Example:

Poly(0,0,-0.5,1,0.5,1.5,2,1,1,-0.5);



  SetPolyClosed Objects - Polys 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   SetPolyClosed
(   polyHandle :HANDLE;
    isClosed :BOOLEAN
) ;

Python:

def  vs.SetPolyClosed(polyHandle, isClosed):
   return None

Description:

Sets the open/closed condition of the referenced poly.



  SetPolylineVertex Objects - Polys 
VectorWorks8.5

VectorScript Declaration:

PROCEDURE   SetPolylineVertex
(   obj :HANDLE;
    vertexNum :INTEGER;
    pX :REAL;
    pY :REAL;
    vertexType :INTEGER;
    arcRadiusDistance :REAL (Coordinate);
    recalcBounds :BOOLEAN
) ;

Python:

def  vs.SetPolylineVertex(obj, vertexNum, p, vertexType, arcRadiusDistance, recalcBounds):
   return None

Description:

Sets the attributes of the specified polyline vertex to the specified values.

Parameters:

obj Handle to object.
vertexNum Index (1-based) of vertex to be modified.
p New X-Y coordinates of vertex.
vertexType Type of vertex.
arcRadiusDistance Radius of vertex corner (arc vertex only).
recalcBounds Recalculate object bounds.

Example:

PROCEDURE Example;
   {This will convert anything it can in the drawing to a polyline
   (including rectangles, polygons, etc.), and then it will fillet
   all of the corners with a radius of .015".}
CONST
   kFilletRadius = .015";
VAR
   cnt :INTEGER;
   x, y :REAL;
   vertexType :INTEGER;
   vertexRadius :REAL;
   criteria :STRING;

PROCEDURE FilletPolygon(h :HANDLE);
BEGIN
   h := ConvertToPolyline(h);
   FOR cnt := 1 to GetVertNum(h) DO BEGIN
      GetPolylineVertex(h, cnt, x, y, vertexType, vertexRadius);
      SetPolylineVertex(h, cnt, x, y, 3, kFilletRadius, TRUE);
   END;
END;

BEGIN
   criteria := '(ALL)';
   ForEachObject(FilletPolygon, criteria);
END;
RUN(Example);



  SetPolyPt Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   SetPolyPt
(   objectHd :HANDLE;
    index :INTEGER;
    xR :REAL;
    yR :REAL
) ;

Python:

def  vs.SetPolyPt(objectHd, index, xR, yR):
   return None

Description:

Procedure SetPolyPt sets the location a specified vertex in the referenced polygon or polyline.

Parameters:

objectHd Handle to polygon.
index Index of vertex.
xR New X coordinate of vertex.
yR New Y coordinate of vertex.



  SetVertexVisibility Objects - Polys 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   SetVertexVisibility
(   h :HANDLE;
    vertnum :INTEGER;
    vis :BOOLEAN
) ;

Python:

def  vs.SetVertexVisibility(h, vertnum, vis):
   return None

Description:

Sets the visibility of the specified vertex of the referenced object.

Parameters:

h Handle to the polygon or polyline.
vertnum Index of the vertex (zero-based).
vis Visibility of the vertex.

See Also:

GetVertexVisibility  



  Smooth Objects - Polys 
MiniCAD

VectorScript Declaration:

PROCEDURE   Smooth
( smoothType:INTEGER ) ;

Python:

def  vs.Smooth(smoothType):
   return None

Description:

Procedure Smooth sets the smoothing type of newly created polyline or polygon objects.

Table - Smoothing Types

Smooth Type Constant
None 0
Bezier 1
Cubic 2
Arc 3

Parameters:

smoothType Smoothing style.

Example:

Smooth(2);
Poly(0,0,-0.5,1,0.5,2);