CalcPolySegLen Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   CalcPolySegLen
(   hPoly :HANDLE;
    i1 :INTEGER;
    i2 :INTEGER
) :REAL ;

Python:

def  vs.CalcPolySegLen(hPoly, i1, i2):
   return REAL

Description:

Calculate the length between two segments of a polygon or polyline



  Centroid Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Centroid
(   h :HANDLE;
  VAR  x :REAL;
  VAR  y :REAL
) :BOOLEAN ;

Python:

def  vs.Centroid(h):
   return (BOOLEAN, x, y)

Description:

Returns the centroid of the object. Returns false if an unsupported object type is supplied.



  CircleCircleInters Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   CircleCircleInters
(   cenPt1 :VECTOR;
    cenPt2 :VECTOR;
    radius1 :REAL;
    radius2 :REAL;
  VAR  pt1 :VECTOR;
  VAR  pt2 :VECTOR
) :BOOLEAN ;

Python:

def  vs.CircleCircleInters(cenPt1, cenPt2, radius1, radius2):
   return (BOOLEAN, pt1, pt2)

Description:

Finds the intersection of two circles.



  ClipPolygon Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   ClipPolygon
(   hPolygon :HANDLE;
    hClipper :HANDLE;
    dFuzz :REAL
) :HANDLE ;

Python:

def  vs.ClipPolygon(hPolygon, hClipper, dFuzz):
   return HANDLE

Description:

Same as IntersectSurface, but improves performance by first checking to see if hClipper is within the bounding box of hPolygon before calling IntersectSurface.



  ClosestPoints Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   ClosestPoints
(   h1 :HANDLE;
    h2 :HANDLE;
  VAR  pt1 :VECTOR;
  VAR  pt2 :VECTOR;
  VAR  touching :BOOLEAN
) ;

Python:

def  vs.ClosestPoints(h1, h2):
   return (pt1, pt2, touching)

Description:

Returns the points on two objects where the shortest distance between those objects occurs. Should support all VW primitives, including polylines and NURBS. Would be nice if it supported groups, symbols, and PIOs. Would also be nice if it supported 3D.



  Cloud Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Cloud
(   h :HANDLE;
    rMin :REAL;
    rMax :REAL;
    hFactor :REAL;
    convex :BOOLEAN;
    removeIntersections :BOOLEAN
) :HANDLE ;

Python:

def  vs.Cloud(h, rMin, rMax, hFactor, convex, removeIntersections):
   return HANDLE

Description:

Draws a cloud. Varies the billows of the clouds randomly between rMin and rMax. The hFactor is the height of each individual arc in the cloud.



  CombinePolygons Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   CombinePolygons
(   hPolygonA :HANDLE;
    hPolygonB :HANDLE;
    dFuzz :REAL
) :HANDLE ;

Python:

def  vs.CombinePolygons(hPolygonA, hPolygonB, dFuzz):
   return HANDLE

Description:

Combines two polygons.



  ConvertToArcPolyline Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   ConvertToArcPolyline
(   hPolygon :HANDLE;
    dFuzz :REAL
) :HANDLE ;

Python:

def  vs.ConvertToArcPolyline(hPolygon, dFuzz):
   return HANDLE

Description:

Returns TRUE if the 3D points are equal within the tolerance.



  ConvertToPolygon Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   ConvertToPolygon
(   h :HANDLE;
    resolution :INTEGER
) :HANDLE ;

Python:

def  vs.ConvertToPolygon(h, resolution):
   return HANDLE

Description:

Converts object to polygon.



  ConvertToPolyline Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   ConvertToPolyline
( h:HANDLE ) :HANDLE ;

Python:

def  vs.ConvertToPolyline(h):
   return HANDLE

Description:

Converts any enclosed shape (circle, rectangle, ellipse, etc.) into a polygon or polyline. Does not polygonalize.



  CutProfileHoles Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   CutProfileHoles
( hWall:HANDLE ) ;

Python:

def  vs.CutProfileHoles(hWall):
   return None

Description:

Cut holes in object geometry described in it's profile group.



  Distance Graphic Calculation 
MiniCAD

VectorScript Declaration:

FUNCTION   Distance
(   x1 :REAL;
    y1 :REAL;
    x2 :REAL;
    y2 :REAL
) :REAL ;

Python:

def  vs.Distance(x1, y1, x2, y2):
   return REAL

Description:

Function Distance returns the distance between the two specified coordinate locations.

Parameters:

x1 X coordinate of first point.
y1 Y coordinate of first point.
x2 X coordinate of second point.
y2 Y coordinate of second point.

Example:

d:=Distance(0,2,4,5);
{returns the distance between (0,2) and (4,5)}

See Also:

Norm  



  Distance3D Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Distance3D
(   x1 :REAL;
    y1 :REAL;
    z1 :REAL;
    x2 :REAL;
    y2 :REAL;
    z2 :REAL
) :REAL ;

Python:

def  vs.Distance3D(x1, y1, z1, x2, y2, z2):
   return REAL

Description:

Returns the 3D distance between two points. Same as Norm.



  EllipseEllipseIntersect Graphic Calculation 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   EllipseEllipseIntersect
( VAR  upperLeft1X :REAL;
  VAR  upperLeft1Y :REAL;
  VAR  lowerRight1X :REAL;
  VAR  lowerRight1Y :REAL;
  VAR  upperLeft2X :REAL;
  VAR  upperLeft2Y :REAL;
  VAR  lowerRight2X :REAL;
  VAR  lowerRight2Y :REAL;
  VAR  int1X :REAL;
  VAR  int1Y :REAL;
  VAR  int2X :REAL;
  VAR  int2Y :REAL;
  VAR  int3X :REAL;
  VAR  int3Y :REAL;
  VAR  int4X :REAL;
  VAR  int4Y :REAL
) :INTEGER ;

Python:

def  vs.EllipseEllipseIntersect(upperLeft1, lowerRight1, upperLeft2, lowerRight2):
   return (INTEGER, int1, int2, int3, int4)

Description:

Calculates the intersections between the two specified ellipses.

Parameters:

upperLeft1 Upper-left point of the first ellipse
lowerRight1 Lower-right point of the first ellipse
upperLeft2 Upper-left point of the second ellipse
lowerRight2 Lower-right point of the second ellipse
int1 On return, first point of intersection, if found
int2 On return, second point of intersection, if found
int3 On return, third point of intersection, if found
int4 On return, fourth point of intersection, if found

Result:

Returns the number of valid intersection points. If the return value is n, the first n points are valid. For example, if the return value is 1, the int1 parameter contains a valid point of intersection, and int2, int3, and int4 are invalid. If the return value is 3, int1, int2, and int3 contain valid points, and int4 is invalid.

Example:

PROCEDURE Example;
VAR
	h1, h2 :HANDLE;
	upperLeft1, lowerRight1 :POINT;
	upperLeft2, lowerRight2 :POINT;
	int1, int2, int3, int4 :POINT;
	num :INTEGER;
BEGIN
	CallTool(-205); h1 := FSActLayer;
	CallTool(-205); h2 := FSActLayer;
	GetBBox(h1, upperLeft1.x, upperLeft1.y, lowerRight1.x, lowerRight1.y);
	GetBBox(h2, upperLeft2.x, upperLeft2.y, lowerRight2.x, lowerRight2.y);
	num := EllipseEllipseIntersect(upperLeft1, lowerRight1, upperLeft2, lowerRight2, int1, int2, int3, int4);
	Message(num);
	Locus(int1.x, int1.y);
	Locus(int2.x, int2.y);
	Locus(int3.x, int3.y);
	Locus(int4.x, int4.y);
END;
RUN(Example);



  Eq Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Eq
(   value1 :REAL;
    value2 :REAL;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.Eq(value1, value2, tolerance):
   return BOOLEAN

Description:

Returns TRUE if the two real numbers are equal within the tolerance.



  EqPercent Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   EqPercent
(   value1 :REAL;
    value2 :REAL;
    percent :REAL
) :BOOLEAN ;

Python:

def  vs.EqPercent(value1, value2, percent):
   return BOOLEAN

Description:

Returns TRUE if num1 and num2 are equal within the given percent.



  EqPt Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   EqPt
(   pt1 :VECTOR;
    pt2 :VECTOR;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.EqPt(pt1, pt2, tolerance):
   return BOOLEAN

Description:

Returns TRUE if the 2D points are equal within the tolerance.



  EqPt2D Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   EqPt2D
(   pt1 :VECTOR;
    pt2 :VECTOR;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.EqPt2D(pt1, pt2, tolerance):
   return BOOLEAN

Description:

Returns TRUE if the 2D points are equal within the tolerance



  EqPt3D Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   EqPt3D
(   pt1 :VECTOR;
    pt2 :VECTOR;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.EqPt3D(pt1, pt2, tolerance):
   return BOOLEAN

Description:

Returns TRUE if the 3D points are equal within the tolerance.



  EqualPt Graphic Calculation 
MiniCAD

VectorScript Declaration:

FUNCTION   EqualPt
(   p1X :REAL;
    p1Y :REAL;
    p2X :REAL;
    p2Y :REAL
) :BOOLEAN ;

Python:

def  vs.EqualPt(p1, p2):
   return BOOLEAN

Description:

Function EqualPt returns whether the two specified coordinate locations are equal (i.e., the same point, to 12 significant digits).

Parameters:

p1 Coordinates of first comparison point.
p2 Coordinates of second comparison point.

Example:

PROCEDURE Example;
VAR
	x1, y1, x2, y2 :REAL;
BEGIN
	x1 := 1;
	y1 := 1;
	x2 := 1.0000000000001;
	y2 := 1.0000000000001;
	Message(EqualPt(x1, y1, x2, y2));
END;
RUN(Example);



  EqualRect Graphic Calculation 
MiniCAD

VectorScript Declaration:

FUNCTION   EqualRect
(   rectAp1X :REAL;
    rectAp1Y :REAL;
    rectAp2X :REAL;
    rectAp2Y :REAL;
    rectBp1X :REAL;
    rectBp1Y :REAL;
    rectBp2X :REAL;
    rectBp2Y :REAL
) :BOOLEAN ;

Python:

def  vs.EqualRect(rectAp1, rectAp2, rectBp1, rectBp2):
   return BOOLEAN

Description:

Function EqualRect returns whether the two specified rectangular areas are equal.

Parameters:

rectAp1 Top left coordinate of rectangle A.
rectAp2 Bottom right coordinate of rectangle A.
rectBp1 Top left coordinate of rectangle B.
rectBp2 Bottom right coordinate of rectangle B.

Example:

AreTheyEqual:=EqualRect(0,0,3,3,3,3,0,0);



  FindObjAtPt_Create Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   FindObjAtPt_Create
(   hContainer :HANDLE;
    objOptions :INTEGER;
    travOptions :INTEGER;
    locX :REAL;
    locY :REAL;
    pickRadius :REAL
) :LONGINT ;

Python:

def  vs.FindObjAtPt_Create(hContainer, objOptions, travOptions, locX, locY, pickRadius):
   return LONGINT

Description:

Creates object find for objects at specified point within specified radius. The funtion is capable of iterating



  FindObjAtPt_Delete Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   FindObjAtPt_Delete
( finderID:LONGINT ) ;

Python:

def  vs.FindObjAtPt_Delete(finderID):
   return None

Description:

Deletes the find object iterator



  FindObjAtPt_GetCount Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   FindObjAtPt_GetCount
( finderID:LONGINT ) :INTEGER ;

Python:

def  vs.FindObjAtPt_GetCount(finderID):
   return INTEGER

Description:

Gets the number of objects in the find iterator



  FindObjAtPt_GetObj Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   FindObjAtPt_GetObj
(   finderID :LONGINT;
    objIndex :INTEGER
) :HANDLE ;

Python:

def  vs.FindObjAtPt_GetObj(finderID, objIndex):
   return HANDLE

Description:

Get an object from the find iterator



  GetObjectHiddenLine Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   GetObjectHiddenLine
(   hGeometry3D :HANDLE;
    cuttingHeight :REAL;
    bottomOfCutPlane :BOOLEAN
) :HANDLE ;

Python:

def  vs.GetObjectHiddenLine(hGeometry3D, cuttingHeight, bottomOfCutPlane):
   return HANDLE

Description:

Create lines representing the hidden line geometry of the specified object.



  GetPtInPoly Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   GetPtInPoly
( h:HANDLE ) :VECTOR ;

Python:

def  vs.GetPtInPoly(h):
   return VECTOR

Description:

Finds a point inside a polyline.



  GetWallHeight Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   GetWallHeight
(   hWall :HANDLE;
  VAR  dStartTopHght :REAL;
  VAR  dStartBotHght :REAL;
  VAR  dEndTopHght :REAL;
  VAR  dEndBotHght :REAL
) ;

Python:

def  vs.GetWallHeight(hWall):
   return (dStartTopHght, dStartBotHght, dEndTopHght, dEndBotHght)

Description:

Returns the height at the start and at the end of a wall.



  GetZatXY Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   GetZatXY
(   hObject :HANDLE;
    X :REAL;
    Y :REAL;
  VAR  outZ :REAL
) :BOOLEAN ;

Python:

def  vs.GetZatXY(hObject, X, Y):
   return (BOOLEAN, outZ)

Description:

Returns the Z elevation of a point X,Y on the specified object. If hObject = NIL then searches all visible objects; hObject = layer - all objects on the layer



  HCenter Graphic Calculation 
MiniCAD

VectorScript Declaration:

PROCEDURE   HCenter
(   h :HANDLE;
  VAR  pX :REAL;
  VAR  pY :REAL
) ;

Python:

def  vs.HCenter(h):
   return p

Description:

Procedure HCenter returns the logical center point of the object specified in h. For most objects, this is the center of the bounding box. For circles, arcs, and round walls HCenter returns the arc center of the object.

Parameters:

h Handle to object.
p X-Y location of object center.



  LineCircleIntersect Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   LineCircleIntersect
(   begPt :VECTOR;
    endPt :VECTOR;
    cenPt :VECTOR;
    radius :REAL;
  VAR  pt1 :VECTOR;
  VAR  pt2 :VECTOR
) :BOOLEAN ;

Python:

def  vs.LineCircleIntersect(begPt, endPt, cenPt, radius):
   return (BOOLEAN, pt1, pt2)

Description:

Finds the intersection points of a line and a circle.



  LineEllipseIntersect Graphic Calculation 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   LineEllipseIntersect
( VAR  a1X :REAL;
  VAR  a1Y :REAL;
  VAR  a2X :REAL;
  VAR  a2Y :REAL;
  VAR  upperRightX :REAL;
  VAR  upperRightY :REAL;
  VAR  lowerLeftX :REAL;
  VAR  lowerLeftY :REAL;
  VAR  int1X :REAL;
  VAR  int1Y :REAL;
  VAR  legal1 :BOOLEAN;
  VAR  int2X :REAL;
  VAR  int2Y :REAL;
  VAR  legal2 :BOOLEAN
) ;

Python:

def  vs.LineEllipseIntersect(a1, a2, upperRight, lowerLeft):
   return (int1, legal1, int2, legal2)

Description:

Calculates the intersection between the specified line and ellipse.

Parameters:

a1 Start point of the line
a2 End point of the line
upperRight Upper-right point of the ellipse
lowerLeft Lower-left point of the ellipse
int1 On return, first point of intersection, if found
legal1 On return, second point of intersection, if found
int2 On return, indicates that int1 is a valid point of intersection
legal2 On return, indicates that int2 is a valid point of intersection



  LineLineIntersection Graphic Calculation 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   LineLineIntersection
( VAR  l1startX :REAL;
  VAR  l1startY :REAL;
  VAR  l1endX :REAL;
  VAR  l1endY :REAL;
  VAR  l2startX :REAL;
  VAR  l2startY :REAL;
  VAR  l2endX :REAL;
  VAR  l2endY :REAL;
  VAR  parallel :BOOLEAN;
  VAR  intOnLines :BOOLEAN;
  VAR  sectptX :REAL;
  VAR  sectptY :REAL
) ;

Python:

def  vs.LineLineIntersection(l1start, l1end, l2start, l2end):
   return (parallel, intOnLines, sectpt)

Description:

Returns intersection point of the two specified lines. parallel is true if the lines are parallel. intOnLines is true if the intersection is on both lines.

Parameters:

l1start Start point of the first line
l1end End point of the first line
l2start Start point of the second line
l2end End point of the second line
parallel On return, true if the lines are parellel, false otherwise
intOnLines On return, true if the lines intersect
sectpt On return, point of intersection of the lines, if the lines intersect

Example:

PROCEDURE Example;
VAR
   pt1, pt2, pt3, pt4, pt5 :POINT;
   parallel, intOnLines :BOOLEAN; 

BEGIN
   CallTool(-201); 
   GetSegPt1(FSActLayer, pt1.x, pt1.y); 
   GetSegPt2(FSActLayer, pt2.x, pt2.y); 
   CallTool(-201); 
   GetSegPt1(FSActLayer, pt3.x, pt3.y); 
   GetSegPt2(FSActLayer, pt4.x, pt4.y); 
   LineLineIntersection(pt1, pt2, pt3, pt4, parallel, intOnLines, pt5); 
   Locus(pt5.x, pt5.y);
END;
RUN(Example);



  OffsetPoly Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   OffsetPoly
(   h :HANDLE;
    offsetDistance :REAL;
    numberOfOffsets :INTEGER;
    consolidateVertices :BOOLEAN;
    sharpCorners :BOOLEAN;
    conversionRes :INTEGER;
    consolidationTolerance :REAL
) :HANDLE ;

Python:

def  vs.OffsetPoly(h, offsetDistance, numberOfOffsets, consolidateVertices, sharpCorners, conversionRes, consolidationTolerance):
   return HANDLE

Description:

Offsets a polygon or polyline. Must handle open & closed polys. A positive distance offsets to the outside; negative to the inside. Should remove self-intersecting segments from the result. Should support smooth vs. sharp offsets.



  OffsetPolyN Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   OffsetPolyN
(   h :HANDLE;
    offsetDistance :REAL;
    smoothCorners :BOOLEAN
) :HANDLE ;

Python:

def  vs.OffsetPolyN(h, offsetDistance, smoothCorners):
   return HANDLE

Description:

Offsets a polygon or polyline. Uses Parasolid to do it. Equivalent of Voronoy based OffsetPoly.



  OverlapLineArc Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   OverlapLineArc
(   begPt :VECTOR;
    endpt :VECTOR;
    cenPt :VECTOR;
    radius :REAL;
    startAng :REAL;
    sweepAng :REAL;
  VAR  lapPt1 :VECTOR;
  VAR  lapPt2 :VECTOR;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.OverlapLineArc(begPt, endpt, cenPt, radius, startAng, sweepAng, tolerance):
   return (BOOLEAN, lapPt1, lapPt2)

Description:

Finds the overlap of a line and an arc. Returns the overlapping segment if it exists.



  OverlapLineLine Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   OverlapLineLine
(   begPt1 :VECTOR;
    endPt1 :VECTOR;
    begPt2 :VECTOR;
    endPt2 :VECTOR;
  VAR  lapPt1 :VECTOR;
  VAR  lapPt2 :VECTOR;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.OverlapLineLine(begPt1, endPt1, begPt2, endPt2, tolerance):
   return (BOOLEAN, lapPt1, lapPt2)

Description:

Returns two points the lap zone of two lines.



  PointAlongPoly Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PointAlongPoly
(   h :HANDLE;
    dist :REAL;
  VAR  pt :VECTOR;
  VAR  tangent :VECTOR
) :BOOLEAN ;

Python:

def  vs.PointAlongPoly(h, dist):
   return (BOOLEAN, pt, tangent)

Description:

Returns a point at the specified distance along the poly, and a vector tangent to the poly at that point.



  PointAlongPolyN Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PointAlongPolyN
(   h :HANDLE;
    dist :REAL;
    epsilon :REAL;
  VAR  pt :VECTOR;
  VAR  tangent :VECTOR
) :BOOLEAN ;

Python:

def  vs.PointAlongPolyN(h, dist, epsilon):
   return (BOOLEAN, pt, tangent)

Description:

Returns a point at the specified distance along the poly, and a vector tangent to the poly at that point. Similar to PointAlongPoly with an addition of an epsilon value.



  PolyMedialAxis Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PolyMedialAxis
( h:HANDLE ) :HANDLE ;

Python:

def  vs.PolyMedialAxis(h):
   return HANDLE

Description:

Creates a group of lines which represent the weighted medial axis of given polygon.



  PtInPoly Graphic Calculation 
MiniCAD

VectorScript Declaration:

FUNCTION   PtInPoly
(   pX :REAL;
    pY :REAL;
    h :HANDLE
) :BOOLEAN ;

Python:

def  vs.PtInPoly(p, h):
   return BOOLEAN

Description:

Function PtInPoly returns TRUE if the point specified point lies within, or on, the referenced polygon or polyline object.

Parameters:

p X-Y coordinate point.
h Handle to polygon.

Example:

PROCEDURE Example;
VAR
	polyHandle :HANDLE;
	locusHandle :HANDLE;
	x, y :REAL;
BEGIN
	CallTool(-204); polyHandle := FSActLayer;
	CallTool(-221); locusHandle := FSActLayer;
	GetLocPt(locusHandle, x, y);
	Message(PtInPoly(x, y, polyHandle));
END;
RUN(Example);



  PtInRect Graphic Calculation 
MiniCAD

VectorScript Declaration:

FUNCTION   PtInRect
(   pointX :REAL;
    pointY :REAL;
    rect1X :REAL;
    rect1Y :REAL;
    rect2X :REAL;
    rect2Y :REAL
) :BOOLEAN ;

Python:

def  vs.PtInRect(point, rect1, rect2):
   return BOOLEAN

Description:

Function PtInRect returns whether the coordinate location is located within the specified rectangular boundary.

Parameters:

point X-Y coordinate point location.
rect1 Top left coordinate of rectangular area.
rect2 Bottom right coordinate of rectangular area.

Example:

PROCEDURE Example;
VAR
	pointX, pointY, rect1X, rect1Y, rect2X, rect2Y :REAL;
BEGIN
	pointX := 1;
	pointY := 1;
	rect1X := 0;
	rect1Y := 2;
	rect2X := 2;
	rect2Y := 0;
	Message(PtInRect(pointX, pointY, rect1X, rect1Y, rect2X, rect2Y));
END;
RUN(Example);



  PtOnArc Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PtOnArc
(   pt :VECTOR;
    cenPt :VECTOR;
    radius :REAL;
    startAng :REAL;
    sweepAng :REAL;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.PtOnArc(pt, cenPt, radius, startAng, sweepAng, tolerance):
   return BOOLEAN

Description:

Determines if a point is on an arc.



  PtOnLine Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PtOnLine
(   pt :VECTOR;
    begPt :VECTOR;
    endPt :VECTOR;
    tolerance :REAL
) :BOOLEAN ;

Python:

def  vs.PtOnLine(pt, begPt, endPt, tolerance):
   return BOOLEAN

Description:

Determines if a point is on a line.



  PtPerpCircle Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PtPerpCircle
(   pt :VECTOR;
    cenPt :VECTOR;
    radius :REAL
) :VECTOR ;

Python:

def  vs.PtPerpCircle(pt, cenPt, radius):
   return VECTOR

Description:

Returns a point on the circle which is closest to the input point.



  PtPerpLine Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   PtPerpLine
(   pt :VECTOR;
    begPt :VECTOR;
    endPt :VECTOR
) :VECTOR ;

Python:

def  vs.PtPerpLine(pt, begPt, endPt):
   return VECTOR

Description:

Returns a point on the input line which is closest to the input point. Doesn't check to see that the point is ON the line.



  RegularPolygon Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   RegularPolygon
(   centerX :REAL;
    centerY :REAL;
    radius :REAL;
    numSides :INTEGER;
    mode :INTEGER
) ;

Python:

def  vs.RegularPolygon(centerX, centerY, radius, numSides, mode):
   return None

Description:

Creates an n-sided polygon.



  RelativeCoords Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   RelativeCoords
(   pt :VECTOR;
    begPt :VECTOR;
    endPt :VECTOR
) :VECTOR ;

Python:

def  vs.RelativeCoords(pt, begPt, endPt):
   return VECTOR

Description:

Translates a point into a coordinate system defined by 2 other points.



  Split2DObjectByLine Graphic Calculation 
VectorWorks12.0

VectorScript Declaration:

PROCEDURE   Split2DObjectByLine
(   objectHd :HANDLE;
    p1X :REAL;
    p1Y :REAL;
    p2X :REAL;
    p2Y :REAL;
  VAR  listHds :HANDLE
) ;

Python:

def  vs.Split2DObjectByLine(objectHd, p1, p2):
   return listHds

Description:

Splits objectHd along a line defined by the two points.

Example:

PROCEDURE Example;
VAR
   polyHandle :HANDLE;
   lineHandle :HANDLE;
   resultHandle :HANDLE;
   begPt :VECTOR;
   endPt :VECTOR;
BEGIN
   CallTool(-204); polyHandle := FSActLayer;
   CallTool(-201); lineHandle := FSActLayer;
   GetSegPt1(lineHandle, begPt.x, begPt.y);
   GetSegPt2(lineHandle, endPt.x, endPt.y);
   Split2DObjectByLine(polyHandle, begPt.x, begPt.y, endPt.x, endPt.y, resultHandle);
   resultHandle := CreateDuplicateObject(resultHandle, NIL);
END;
RUN(Example);



  SrndArea Graphic Calculation 
MiniCAD

VectorScript Declaration:

FUNCTION   SrndArea
(   pX :REAL;
    pY :REAL
) :REAL ;

Python:

def  vs.SrndArea(p):
   return REAL

Description:

Function SrndArea when given a point, returns the area of the smallest polygon bounded by the selected objects.

Parameters:

p Coordinates of reference point.



  Stipple Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   Stipple
(   hProfileObject :HANDLE;
    shapeType :INTEGER;
    density :INTEGER;
    clipToProfile :INTEGER;
    minSize :REAL;
    maxSize :REAL;
    minAspectRatio :REAL;
    maxAspectRatio :REAL;
    randomRotate :BOOLEAN
) :HANDLE ;

Python:

def  vs.Stipple(hProfileObject, shapeType, density, clipToProfile, minSize, maxSize, minAspectRatio, maxAspectRatio, randomRotate):
   return HANDLE

Description:

Greates a group of 'stipple-shapes', objects that fill a 'profile object'



  SubtractPolygon Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   SubtractPolygon
(   hMinuedPoly :HANDLE;
    hSubtrahend :HANDLE;
    dFuzz :REAL
) :HANDLE ;

Python:

def  vs.SubtractPolygon(hMinuedPoly, hSubtrahend, dFuzz):
   return HANDLE

Description:

Clips one polygon from the other.



  ThreePtCenter Graphic Calculation 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   ThreePtCenter
(   pt1 :VECTOR;
    pt2 :VECTOR;
    pt3 :VECTOR
) :VECTOR ;

Python:

def  vs.ThreePtCenter(pt1, pt2, pt3):
   return VECTOR

Description:

Returns the center of a circle passing thru 3 given points.



  UnionRect Graphic Calculation 
MiniCAD

VectorScript Declaration:

PROCEDURE   UnionRect
(   p1X :REAL;
    p1Y :REAL;
    p2X :REAL;
    p2Y :REAL;
    p3X :REAL;
    p3Y :REAL;
    p4X :REAL;
    p4Y :REAL;
  VAR  p5X :REAL;
  VAR  p5Y :REAL;
  VAR  p6X :REAL;
  VAR  p6Y :REAL
) ;

Python:

def  vs.UnionRect(p1, p2, p3, p4, p5, p6):
   return (p5, p6)

Description:

Procedure UnionRect returns a rectangle based on the boundary enclosing the two specified rectangles.


Parameters:

p1 Top left coordinate of rectangle 1.
p2 Bottom right coordinate of rectangle 1.
p3 Top left coordinate of rectangle 2.
p4 Bottom right coordinate of rectangle 2.
p5 Top left coordinate of boundary rectangle.
p6 Bottom right coordinate of boundary rectangle.

Example:

UnionRect(0,0,3,3,3,3,5,5,x1,y1,x2,y2);