<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Draw large Number of circles in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9163435#M13177</link>
    <description>&lt;P&gt;A sketch in Fusion 360 is doing a lot more than just drawing 2D geometry and because of that, it's not very good with large sketches.&amp;nbsp; For example, when you're sketching it's analyzing all of the geometry to calculate possible profiles in the sketch and if there are constraints, it's solving the sketch for those.&amp;nbsp; I would recommend breaking up your circles into groups and creating multiple sketches.&amp;nbsp; Each one is solved independently.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Nov 2019 17:41:08 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2019-11-23T17:41:08Z</dc:date>
    <item>
      <title>Draw large Number of circles</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9163269#M13176</link>
      <description>&lt;P&gt;Hello, everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm quite new to Fusion 360 environment, I'm trying to use the API to draw a large number of circles around 10.000, I have a file that contains the coordinates and the radius of each circle where the script reads the inputs for circle drawing, the problem is that I'm running out of memory then the software crash, so I'm looking for a better way to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;import adsk.core, adsk.fusion, traceback, csv
def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        
        doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        
        design = app.activeProduct

        # Get the root component of the active design.
        rootComp = design.rootComponent

        # Create a new sketch on the xy plane.
        sketches = rootComp.sketches
        xyPlane = rootComp.xYConstructionPlane
        sketch = sketches.add(xyPlane)
        circles = sketch.sketchCurves.sketchCircles

        #Open the File 
        with open('C:\\the\pathl\SampleXYandR.csv', 'r') as f:
                  content = csv.reader(f) 
                  for line in content:
                   x=float(line[0])
                   y=float(line[1])
                   z=float(line[2])
                   r=float(line[3])
#                 Draw some circles.
                   circle1 = circles.addByCenterRadius(adsk.core.Point3D.create(y, z, 0), r)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Nov 2019 13:11:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9163269#M13176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-23T13:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Draw large Number of circles</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9163435#M13177</link>
      <description>&lt;P&gt;A sketch in Fusion 360 is doing a lot more than just drawing 2D geometry and because of that, it's not very good with large sketches.&amp;nbsp; For example, when you're sketching it's analyzing all of the geometry to calculate possible profiles in the sketch and if there are constraints, it's solving the sketch for those.&amp;nbsp; I would recommend breaking up your circles into groups and creating multiple sketches.&amp;nbsp; Each one is solved independently.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2019 17:41:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9163435#M13177</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-11-23T17:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Draw large Number of circles</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9164669#M13178</link>
      <description>&lt;P&gt;thank you for your reply ,I think dividing the circles to groups might the best choice&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 02:54:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/draw-large-number-of-circles/m-p/9164669#M13178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-25T02:54:58Z</dc:date>
    </item>
  </channel>
</rss>

