VS:RegularPolygon: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Creates a regular polygon of nSides sides. Mode 1 creates a circumscribed poly, mode 2 an inscribed poly.
Creates an n-sided polygon.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
PROCEDURE RegularPolygon(centerX :REAL; centerY :REAL; radius :REAL; numSides :INTEGER; mode :INTEGER);
PROCEDURE RegularPolygon(centerX:REAL; centerY:REAL; radius:REAL; numSides:INTEGER; mode:INTEGER);
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 49: Line 48:
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
The object so created is not accessible to LNewObj, so you have to create something else first (like a locus), then call RegularPolygon, then use NextObj(firstObjectCreated) to find the polygon, then delete the dummy object.
 
centerX and centerY should be specified in millimeters (until this call gets standardized, and then uses document units).
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  cx, cy, radius :REAL;
  numsides, mode :INTEGER;
BEGIN
  Message('Pick center point...');
  GetPt(cx, cy);
  radius  := RealDialog('Enter radius:', '10');
  numsides := IntDialog('Enter num sides:', '10');
  mode    := IntDialog('Enter mode: 1 - circumscribed poly; 2 - inscribed poly', '1');
  RegularPolygon(cx, cy, radius, numsides, mode);
  Message('Done!');
END;
RUN(Example);</code>
 
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
</seeAlso>


</vwDoc>
</vwDoc>


[[Category:VS Function Reference|RegularPolygon]]
[[Category:VS Function Reference|RegularPolygon]]
[[Category:VS Function Reference:Objects - 2D|RegularPolygon]]
[[Category:VS Function Reference:Graphic Calculation|RegularPolygon]]

Revision as of 17:35, 18 September 2013

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Creates an n-sided polygon.

PROCEDURE RegularPolygon(
centerX :REAL;
centerY :REAL;
radius :REAL;
numSides :INTEGER;
mode :INTEGER);
def vs.RegularPolygon(centerX, centerY, radius, numSides, mode):
    return None

Parameters

centerX REAL
centerY REAL
radius REAL
numSides INTEGER
mode INTEGER

Version

Availability: from Vectorworks 2014