<?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: Is there a way to batch delete curves? in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7879990#M19307</link>
    <description>&lt;P&gt;Deleting curves is still insanely slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation where I construct geometry, offset it, and then want to delete the original geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In some cases before I was able to directly construct the offset geometry, but in this case that is proving ... awkward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a fast way to delete a set of curves?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 19:30:15 GMT</pubDate>
    <dc:creator>edwinBN4C3</dc:creator>
    <dc:date>2018-03-23T19:30:15Z</dc:date>
    <item>
      <title>Is there a way to batch delete curves?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/6582414#M19305</link>
      <description>&lt;P&gt;I find that deleting (many)&amp;nbsp;&lt;SPAN&gt;curves&amp;nbsp;&lt;/SPAN&gt;via the API is extremely slow (on the order of 200ms to 250ms per curve). Is there an API call I can make that will delete a list of curves?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I can't batch delete I'm going to have to collect the lines i want to keep and project them into a new sketch instead which is silly&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2016 17:28:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/6582414#M19305</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-24T17:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to batch delete curves?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/6590674#M19306</link>
      <description>&lt;P&gt;This is a good request and something I've added to our backlog and I hope we can provide it soon.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 21:47:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/6590674#M19306</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2016-09-28T21:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to batch delete curves?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7879990#M19307</link>
      <description>&lt;P&gt;Deleting curves is still insanely slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation where I construct geometry, offset it, and then want to delete the original geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In some cases before I was able to directly construct the offset geometry, but in this case that is proving ... awkward.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a fast way to delete a set of curves?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 19:30:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7879990#M19307</guid>
      <dc:creator>edwinBN4C3</dc:creator>
      <dc:date>2018-03-23T19:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to batch delete curves?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7882700#M19308</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try "Product::deleteEntities" to batch delete curves? The following sample demos how to delete lines and arcs from a sketch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        design = adsk.fusion.Design.cast(app.activeProduct)
        root = design.rootComponent
        
        sketch = root.sketches.item(0)
        entities = adsk.core.ObjectCollection.create()
        
        for line in sketch.sketchCurves.sketchLines:
            entities.add(line)
            
        for arc in sketch.sketchCurves.sketchArcs:
            entities.add(arc)
            
        design.deleteEntities(entities)
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Mar 2018 01:09:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7882700#M19308</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2018-03-26T01:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to batch delete curves?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7883893#M19309</link>
      <description>&lt;P&gt;Cool, I'll have to give it a try. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 12:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/is-there-a-way-to-batch-delete-curves/m-p/7883893#M19309</guid>
      <dc:creator>edwinBN4C3</dc:creator>
      <dc:date>2018-03-26T12:38:09Z</dc:date>
    </item>
  </channel>
</rss>

