VS:ConvertToPolygon: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
(wikify, thank you Raymond!)
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Converts object to polygon.
Converts object to polygon.</desc>
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION ConvertToPolygon(h :HANDLE; resolution :INTEGER) :HANDLE;
FUNCTION ConvertToPolygon(h:HANDLE; resolution:INTEGER) : HANDLE;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 34: Line 33:
</lineList>
</lineList>
</params>
</params>
-----------------------------------------------------------------------------------------------------------
<return>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark>
'''Notes:''' (RMullin - 2020 Mar 03)
# Setting "resolution" higher creates more vertices. Magic numbers for "resolution" are [0, 8, 16, 32, 64, 128, 256, 512].
#: Integer values between the numbers in this list generate duplicate results.
#: Values outside this range do not appear to affect the number of vertices generated.
# This function creates a duplicate object, so you don't have to duplicate the object beforehand if you want to retain the original object.
# If the original is selected, the duplicate will be selected, and vice versa.


</remark>
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<sample></sample>
<code lang="pas">
PROCEDURE Example;
VAR
  h, h1 :HANDLE;
  res  :INTEGER;
BEGIN
  h := FSActLayer;
  IF h = NIL THEN
      AlrtDialog('You should select an object before running this script')
  ELSE BEGIN
      res := IntDialog('Enter resolution', '16');
      h1 := ConvertToPolygon(h, res);
  END;
END;
RUN(Example);</code>


</sample>
-----------------------------------------------------------------------------------------------------------
<seeAlso></seeAlso>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<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|ConvertToPolygon]]
[[Category:VS Function Reference|ConvertToPolygon]]
[[Category:VS Function Reference:Objects - 2D|ConvertToPolygon]]
[[Category:VS Function Reference:Graphic Calculation|ConvertToPolygon]]

Latest revision as of 09:02, 3 March 2020

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

Description

Converts object to polygon.

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

Parameters

h HANDLE
resolution INTEGER

Remarks

Notes: (RMullin - 2020 Mar 03)

  1. Setting "resolution" higher creates more vertices. Magic numbers for "resolution" are [0, 8, 16, 32, 64, 128, 256, 512].
    Integer values between the numbers in this list generate duplicate results.
    Values outside this range do not appear to affect the number of vertices generated.
  2. This function creates a duplicate object, so you don't have to duplicate the object beforehand if you want to retain the original object.
  3. If the original is selected, the duplicate will be selected, and vice versa.

Version

Availability: from Vectorworks 2014