<?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: Maxing out memory in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063270#M13508</link>
    <description>&lt;P&gt;I don't think you can easily concatenate them, but you may be able to import them all at once. The code I'm testing currently, if you want to try it, is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;app = adsk.core.Application.get()
ui  = app.userInterface
projects = app.data.dataProjects

allDocs = app.documents
currentDoc = app.activeDocument
currentDocName = currentDoc.name

timeList = []

for i in range(200):

	# Keep track of time taken. Used to reset document if too much memory has accumulated
	startTime = time.time()
		
	YOUR_SKETCH_FUNCTION(circleSketch)
	
	totalTime = time.time() - startTime
	
	timeList.append(totalTime)
	
	# If time has increase substantially, close and re-open the model.
	if totalTime &amp;gt; timeList[0] * 2.5:
	
		timeList = []
		currentDoc.close(False)
		
		startTime = time.time()
		
		for project in projects:
			if "YOUR PROJECT NAME" in project.name:
				folder = project.rootFolder
				for file in folder.dataFiles:
					if file.name in currentDocName:
						openFile = allDocs.open(file)
						activateFile = openFile.activate()
						
						currentDoc = app.activeDocument
						currentDocName = currentDoc.name
						
						product = app.activeProduct
						# Get the root component of the active design.
						rootComp = product.rootComponent           
						
						# Get sketches
						sketches = rootComp.sketches
						for sketch in sketches:
						
							# Find the Date Text sketch
							if sketch.name == "YOUR SKETCH NAME":
								circleSketch = sketch&lt;/PRE&gt;&lt;P&gt;I tried to format it so it would be easier for you to use in your case.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 19:50:08 GMT</pubDate>
    <dc:creator>zachesenbock</dc:creator>
    <dc:date>2019-10-02T19:50:08Z</dc:date>
    <item>
      <title>Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062848#M13497</link>
      <description>&lt;P&gt;I am maxing out my computer memory with Fusion 360 using up 12 GB of memory by itself with a script I'm running.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to draw 200 square sheets, each with a perforated pattern of circles (about 600 circles to each sheet).&amp;nbsp; I have verified that the script works for 2 sheets, but when I go more than about 5 sheets, the Fusion 360 crashes. I am just drawing 2D circles and squares on the XY construction plane so I don't understand why it is taking so much memory to make a 2D drawing. Is there not a 2-D only drawing mode you can access through scripting? I have to draw about 100,000 circular holes in total for the 200 square sheets and will be exporting it as a DXF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 16:57:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062848#M13497</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T16:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062870#M13498</link>
      <description>&lt;P&gt;Have you tried using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sketch.isComputeDeferred = True&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;before the circles are drawn, and then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sketch.isComputeDeferred = False&lt;/PRE&gt;&lt;P&gt;after?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:06:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062870#M13498</guid>
      <dc:creator>zachesenbock</dc:creator>
      <dc:date>2019-10-02T17:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062899#M13499</link>
      <description>&lt;P&gt;Do you have to do all 200 sheets at once? You could do a few, export them and reset the document, do a few more, export them, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might also investigate using the TemporaryBRepManager to create 2d geometry, which is a much much lighter weight operation than drawing in a sketch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g. to create a circle, you can use brep.&lt;SPAN&gt;createCylinderOrCone(), and then take the top or bottom face of the cylinder and convert just that face to a separate body. Similar for a square/rectangle - you can create a cube and take one of the faces. And you can use&amp;nbsp;brep.booleanOperation with a boolean type of DifferenceBooleanType to cut out the holes from the sheet.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to try a somewhat nicer wrapper around the TemporaryBRepManager, you can check out my &lt;A href="https://github.com/JesusFreke/fscad" target="_blank" rel="noopener"&gt;fscad&lt;/A&gt; project. A rough example might be something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;adsk.core, adsk.fusion&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;fscad &lt;SPAN&gt;import &lt;/SPAN&gt;*&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;(_):&lt;BR /&gt;    sheet = Rect(&lt;SPAN&gt;100&lt;/SPAN&gt;, &lt;SPAN&gt;100&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    hole1 = Circle(&lt;SPAN&gt;2&lt;/SPAN&gt;)&lt;BR /&gt;    # place the hole 20cm inward from the bottom and left edges&lt;BR /&gt;    hole1.place(&lt;BR /&gt;        (~hole1 == -sheet) + &lt;SPAN&gt;20&lt;/SPAN&gt;, &lt;SPAN&gt;# align the middle of the hole (~hole) with the left edge of the sheet (-sheet), and then move it inward by 20&lt;BR /&gt;&lt;/SPAN&gt;        (~hole1 == -sheet) + &lt;SPAN&gt;20&lt;/SPAN&gt;, &lt;SPAN&gt;# align the middle of the hole (~hole) with the bottom edge of the sheet (-sheet), and then move it inward by 20&lt;BR /&gt;&lt;/SPAN&gt;        ~hole1 == ~sheet)&lt;BR /&gt;&lt;BR /&gt;    assembly = Difference(sheet, hole1)&lt;BR /&gt;&lt;BR /&gt;    assembly.create_occurrence()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062899#M13499</guid>
      <dc:creator>JesusFreke</dc:creator>
      <dc:date>2019-10-02T17:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062957#M13500</link>
      <description>&lt;P&gt;Wow, I didn't even know that existed! It does seem to have solved the memory issue. It is now hovering around ~2 GB while generating the circles.&amp;nbsp; I am testing it out with 24 sheets now.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:32:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062957#M13500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T17:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062969#M13501</link>
      <description>&lt;P&gt;Thanks JesusFreke,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a drawing which will be sent to a laser cutting bed of 5 foot by 10 foot, so I need all the squares to be aligned on the same drawing.&amp;nbsp; I could potentially draw each sheet on a separate DXF and then superimpose them all somehow outside of Fusion 360, but if this works I would rather do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will have to look into the Temporary Brep manager if simply deferring the computing doesn't work for the full drawing. Thanks for the suggestion.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:35:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9062969#M13501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T17:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063116#M13502</link>
      <description>&lt;P&gt;Ok, so while the deferred computing fixed part of the issue, it is obviously taking more time from one sheet to the next as the number of sheets increases. I set it to give a messageBox every time it makes a new sheet, and the time to create each sheet is increasing as the number of sheets increases.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you simply take one of the cylinder faces from a &lt;SPAN&gt;brep.&lt;/SPAN&gt;&lt;SPAN&gt;createCylinderOrCone()&lt;/SPAN&gt; and convert it to a 2D body?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 18:36:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063116#M13502</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T18:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063167#M13503</link>
      <description>&lt;P&gt;Are all the sheets existing together in the same document, or are you clearing it and then starting the next one?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 18:59:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063167#M13503</guid>
      <dc:creator>zachesenbock</dc:creator>
      <dc:date>2019-10-02T18:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063177#M13504</link>
      <description>&lt;P&gt;They are all on the same document. I need to draw them all on a single&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="grid.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683799i83F08DB8F3E84846/image-size/large?v=v2&amp;amp;px=999" role="button" title="grid.png" alt="grid.png" /&gt;&lt;/span&gt; 5' x 10' canvas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is an example of one sheet&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 19:01:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063177#M13504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T19:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063200#M13505</link>
      <description>&lt;P&gt;If you export them all as one file then I'm not sure anything in the API can help with the accumulating calculation time. If you exported the sheets individually then I would've suggested having the script close and re-open the document. I'm currently running some experiments with this and it shows some promise at making the time increases at little less... exponential.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 19:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063200#M13505</guid>
      <dc:creator>zachesenbock</dc:creator>
      <dc:date>2019-10-02T19:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063207#M13506</link>
      <description>&lt;P&gt;Can multiple DXFs be overlaid onto a single DXF? If I make 200 DXFs with the sheets in their proper position individually, is there a way to combine them all into one?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 19:16:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063207#M13506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T19:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063270#M13508</link>
      <description>&lt;P&gt;I don't think you can easily concatenate them, but you may be able to import them all at once. The code I'm testing currently, if you want to try it, is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;app = adsk.core.Application.get()
ui  = app.userInterface
projects = app.data.dataProjects

allDocs = app.documents
currentDoc = app.activeDocument
currentDocName = currentDoc.name

timeList = []

for i in range(200):

	# Keep track of time taken. Used to reset document if too much memory has accumulated
	startTime = time.time()
		
	YOUR_SKETCH_FUNCTION(circleSketch)
	
	totalTime = time.time() - startTime
	
	timeList.append(totalTime)
	
	# If time has increase substantially, close and re-open the model.
	if totalTime &amp;gt; timeList[0] * 2.5:
	
		timeList = []
		currentDoc.close(False)
		
		startTime = time.time()
		
		for project in projects:
			if "YOUR PROJECT NAME" in project.name:
				folder = project.rootFolder
				for file in folder.dataFiles:
					if file.name in currentDocName:
						openFile = allDocs.open(file)
						activateFile = openFile.activate()
						
						currentDoc = app.activeDocument
						currentDocName = currentDoc.name
						
						product = app.activeProduct
						# Get the root component of the active design.
						rootComp = product.rootComponent           
						
						# Get sketches
						sketches = rootComp.sketches
						for sketch in sketches:
						
							# Find the Date Text sketch
							if sketch.name == "YOUR SKETCH NAME":
								circleSketch = sketch&lt;/PRE&gt;&lt;P&gt;I tried to format it so it would be easier for you to use in your case.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 19:50:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063270#M13508</guid>
      <dc:creator>zachesenbock</dc:creator>
      <dc:date>2019-10-02T19:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063337#M13509</link>
      <description>&lt;P&gt;The following runs in just under 1 second on my machine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;adsk.core&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;adsk.fusion&lt;BR /&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;adsk.core &lt;SPAN&gt;import &lt;/SPAN&gt;Point3D, Vector3D, OrientedBoundingBox3D, Matrix3D&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;time&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;app&lt;/SPAN&gt;():&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;adsk.core.Application.get()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;design&lt;/SPAN&gt;():&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;adsk.fusion.Design.cast(app().activeProduct)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;root&lt;/SPAN&gt;() -&amp;gt; adsk.fusion.Component:&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;design().rootComponent&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;brep&lt;/SPAN&gt;():&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;adsk.fusion.TemporaryBRepManager.get()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;rect&lt;/SPAN&gt;(x, y, width, height):&lt;BR /&gt;    &lt;SPAN&gt;# The top face of a box is always index 0&lt;BR /&gt;&lt;/SPAN&gt;    top_index = &lt;SPAN&gt;0&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    top_face = brep().createBox(OrientedBoundingBox3D.create(&lt;BR /&gt;        Point3D.create(&lt;BR /&gt;            x + width/&lt;SPAN&gt;2&lt;/SPAN&gt;,&lt;BR /&gt;            y + width/&lt;SPAN&gt;2&lt;/SPAN&gt;,&lt;BR /&gt;            -&lt;SPAN&gt;.5&lt;/SPAN&gt;),&lt;BR /&gt;        Vector3D.create(&lt;SPAN&gt;1&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;),&lt;BR /&gt;        Vector3D.create(&lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;1&lt;/SPAN&gt;, &lt;SPAN&gt;0&lt;/SPAN&gt;),&lt;BR /&gt;        width, height, &lt;SPAN&gt;1&lt;/SPAN&gt;)).faces[top_index]&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;brep().copy(top_face)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;circle&lt;/SPAN&gt;(x, y, radius):&lt;BR /&gt;    &lt;SPAN&gt;# The top face of a cylinder is always index 2&lt;BR /&gt;&lt;/SPAN&gt;    top_index = &lt;SPAN&gt;2&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    top_face = brep().createCylinderOrCone(&lt;BR /&gt;        Point3D.create(x, y, -&lt;SPAN&gt;1&lt;/SPAN&gt;), radius,&lt;BR /&gt;        Point3D.create(x, y, &lt;SPAN&gt;0&lt;/SPAN&gt;), radius).faces[top_index]&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;brep().copy(top_face)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;difference&lt;/SPAN&gt;(target, *tools):&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;tool &lt;SPAN&gt;in &lt;/SPAN&gt;tools:&lt;BR /&gt;        brep().booleanOperation(target, tool, adsk.fusion.BooleanTypes.DifferenceBooleanType)&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;target&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;union&lt;/SPAN&gt;(*bodies):&lt;BR /&gt;    target = &lt;SPAN&gt;None&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    for &lt;/SPAN&gt;body &lt;SPAN&gt;in &lt;/SPAN&gt;bodies:&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;target &lt;SPAN&gt;is None&lt;/SPAN&gt;:&lt;BR /&gt;            target = body&lt;BR /&gt;        &lt;SPAN&gt;else&lt;/SPAN&gt;:&lt;BR /&gt;            brep().booleanOperation(target, body, adsk.fusion.BooleanTypes.UnionBooleanType)&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;target&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;create_occurrence&lt;/SPAN&gt;(body):&lt;BR /&gt;    occurrence = root().occurrences.addNewComponent(Matrix3D.create())&lt;BR /&gt;    occurrence.component.bRepBodies.add(body)&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;occurrence&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;run&lt;/SPAN&gt;(_):&lt;BR /&gt;    start = time.time()&lt;BR /&gt;&lt;BR /&gt;    design().designType = adsk.fusion.DesignTypes.DirectDesignType&lt;BR /&gt;&lt;BR /&gt;    sheets = []&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;row &lt;SPAN&gt;in &lt;/SPAN&gt;&lt;SPAN&gt;range&lt;/SPAN&gt;(&lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;10&lt;/SPAN&gt;):&lt;BR /&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;col &lt;SPAN&gt;in &lt;/SPAN&gt;&lt;SPAN&gt;range&lt;/SPAN&gt;(&lt;SPAN&gt;0&lt;/SPAN&gt;, &lt;SPAN&gt;20&lt;/SPAN&gt;):&lt;BR /&gt;            sheet = rect(col * &lt;SPAN&gt;102&lt;/SPAN&gt;, row * &lt;SPAN&gt;102&lt;/SPAN&gt;, &lt;SPAN&gt;100&lt;/SPAN&gt;, &lt;SPAN&gt;100&lt;/SPAN&gt;)&lt;BR /&gt;            hole = circle(col * &lt;SPAN&gt;102 &lt;/SPAN&gt;+ &lt;SPAN&gt;20&lt;/SPAN&gt;, row * &lt;SPAN&gt;102 &lt;/SPAN&gt;+ &lt;SPAN&gt;20&lt;/SPAN&gt;, &lt;SPAN&gt;2&lt;/SPAN&gt;)&lt;BR /&gt;            sheets.append(difference(sheet, hole))&lt;BR /&gt;&lt;BR /&gt;    occurrence = create_occurrence(union(*sheets))&lt;BR /&gt;&lt;BR /&gt;    sketch = root().sketches.add(root().xYConstructionPlane)&lt;BR /&gt;    sketch.include(occurrence.bRepBodies[&lt;SPAN&gt;0&lt;/SPAN&gt;])&lt;BR /&gt;&lt;BR /&gt;    occurrence.deleteMe()&lt;BR /&gt;&lt;BR /&gt;    end = time.time()&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(end-start)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sheet_test.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/683827i0C32455F1BDC64B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sheet_test.png" alt="sheet_test.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 20:16:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063337#M13509</guid>
      <dc:creator>JesusFreke</dc:creator>
      <dc:date>2019-10-02T20:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063367#M13510</link>
      <description>&lt;P&gt;I just tried it with a 15x15 grid of holes in each sheet, to simulate a more representative example, and it took a while to create the sketch. It was about 2 and a half minutes total, and it got up to about 8gb mem usage (private bytes, per SysInternal's ProcessExplorer)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 20:33:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063367#M13510</guid>
      <dc:creator>JesusFreke</dc:creator>
      <dc:date>2019-10-02T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063660#M13511</link>
      <description>&lt;P&gt;Interesting. After leaving my code running apparently it is working, it is just slow. I think I will stick with the sketch method as long as I can export the single DXF at the end. I will probably have to leave it running overnight.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do either of you know if it is possible to set the canvas / image size to exactly 10 foot by 5 foot (X by Y -&amp;gt; 302.4 by 152.4 cm)? The dimensions are important for laser cutting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 23:20:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9063660#M13511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T23:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Maxing out memory</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9064040#M13512</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hi Fellows,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you are dealing with here is a &lt;FONT color="#0000FF"&gt;quite simple structure&lt;/FONT&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to &lt;FONT color="#FF0000"&gt;speed up&lt;/FONT&gt; the process of generation representative DXF .... just skip F360 in the process.&lt;/P&gt;&lt;P&gt;When you open DXF in ASCII editor you will find that the syntax required can be generated quickly and easily by direct assembling/programming the file content.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 07:00:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/maxing-out-memory/m-p/9064040#M13512</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2019-10-03T07:00:53Z</dc:date>
    </item>
  </channel>
</rss>

