VS:RegularPolygon: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
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 45: Line 44:
mode
mode
INTEGER
INTEGER
 
1 - circumscribed; 2 - inscribed
</line>
</line>
</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]]

Latest revision as of 19:26, 13 March 2015

.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 1 - circumscribed; 2 - inscribed

Version

Availability: from Vectorworks 2014