VS:Centroid: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Returns the centroid of the object. Returns false if an unsupported object type is supplied.
Returns the centroid of the object. Returns false if an unsupported object type is supplied.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION Centroid(h :HANDLE; VAR x :REAL; VAR y :REAL) :BOOLEAN;
FUNCTION Centroid(h:HANDLE; VAR x:REAL; VAR y:REAL) : BOOLEAN;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 30: Line 29:
x
x
REAL
REAL
Output parameter.
 
</line>
</line>
<line>
<line>
y
y
REAL
REAL
Output parameter.
 
</line>
</line>
</lineList>
</lineList>
</params>
</params>


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


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
 
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  h :HANDLE;
  x, y :REAL;
BEGIN
  h := FSActLayer;
  IF Centroid(h, x, y) THEN BEGIN
      x := x / (25.4 / GetPrefReal(152));
      y := y / (25.4 / GetPrefReal(152));
      Locus(x, y);
  END;
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>

Revision as of 17:35, 18 September 2013

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

Description

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

FUNCTION Centroid(
h :HANDLE;
VAR x :REAL;
VAR y :REAL) : BOOLEAN;
def vs.Centroid(h):
    return (BOOLEAN, x, y)

Parameters

h HANDLE
x REAL
y REAL

Version

Availability: from Vectorworks 2014