AddPoint Objects - Polys 

Declaration:

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

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 

Declaration:

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

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 Coordiantes 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 

Declaration:

PROCEDURE   BeginPoly
;

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 

Declaration:

PROCEDURE   ClosePoly
;

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 

Declaration:

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

Description:

Procedure CurveThrough fits a cubic spline through the specified point.

Parameters:

p Coordinates of vertex.



  CurveTo Objects - Polys 

Declaration:

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

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 

Declaration:

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

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.

Example:





  EndPoly Objects - Polys 

Declaration:

PROCEDURE   EndPoly
;

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.



  GetPolyPt Objects - Polys 

Declaration:

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

Description:

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

Parameters:

objectHd Handle to polygon.
index Index of vertex.
p Returns coordinates of vertex.

Example:





  GetVertNum Objects - Polys 

Declaration:

FUNCTION   GetVertNum
( PolyHd:HANDLE ) :INTEGER ;

Description:

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

Parameters:

PolyHd Handle to polygon.

Example:





  OpenPoly Objects - Polys 

Declaration:

PROCEDURE   OpenPoly
;

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 

Declaration:

PROCEDURE   Poly
(   x1 :REAL;
    y1 :REAL;
    x2 :REAL;
    y2 :REAL;
    ... :REAL;
    xn :REAL;
    yn :REAL
) ;

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);



  SetPolyPt Objects - Polys 

Declaration:

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

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.

Example:





  Smooth Objects - Polys 

Declaration:

PROCEDURE   Smooth
( smoothType:INTEGER ) ;

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);