<?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 Creating and Referencing Sweep features where pre-existing sweep features exist in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/creating-and-referencing-sweep-features-where-pre-existing-sweep/m-p/10972943#M6506</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm having trouble running a script multiple times in the same design.&lt;/P&gt;&lt;P&gt;I am writing a script to add a sweep on a selected profile loop on an existing sketch.&lt;/P&gt;&lt;P&gt;The intent is to run the script multiple times on the same sketch, selecting different profiles each time to build up a body for machining&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first time the script runs it creates the sweep features around the profile loop correctly.&lt;/P&gt;&lt;P&gt;The second time the script is run on a different profile loop it fails.&lt;/P&gt;&lt;P&gt;I reference the Sweep Features Collection in the script to apply trims etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is best practice?&lt;/P&gt;&lt;P&gt;1) Do I need to save the number of items already in the collection and apply an offset when referencing them for trims etc or is there a better method of returning the sweep features created when the script runs that considers other sweeps already in the design before the script is run.&lt;/P&gt;&lt;P&gt;2) apply attributes or save references to the features in the script.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Paul.&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>Sat, 26 Feb 2022 01:03:45 GMT</pubDate>
    <dc:creator>Aaargh74</dc:creator>
    <dc:date>2022-02-26T01:03:45Z</dc:date>
    <item>
      <title>Creating and Referencing Sweep features where pre-existing sweep features exist</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/creating-and-referencing-sweep-features-where-pre-existing-sweep/m-p/10972943#M6506</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm having trouble running a script multiple times in the same design.&lt;/P&gt;&lt;P&gt;I am writing a script to add a sweep on a selected profile loop on an existing sketch.&lt;/P&gt;&lt;P&gt;The intent is to run the script multiple times on the same sketch, selecting different profiles each time to build up a body for machining&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first time the script runs it creates the sweep features around the profile loop correctly.&lt;/P&gt;&lt;P&gt;The second time the script is run on a different profile loop it fails.&lt;/P&gt;&lt;P&gt;I reference the Sweep Features Collection in the script to apply trims etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is best practice?&lt;/P&gt;&lt;P&gt;1) Do I need to save the number of items already in the collection and apply an offset when referencing them for trims etc or is there a better method of returning the sweep features created when the script runs that considers other sweeps already in the design before the script is run.&lt;/P&gt;&lt;P&gt;2) apply attributes or save references to the features in the script.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Paul.&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>Sat, 26 Feb 2022 01:03:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/creating-and-referencing-sweep-features-where-pre-existing-sweep/m-p/10972943#M6506</guid>
      <dc:creator>Aaargh74</dc:creator>
      <dc:date>2022-02-26T01:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating and Referencing Sweep features where pre-existing sweep features exist</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/creating-and-referencing-sweep-features-where-pre-existing-sweep/m-p/10974816#M6507</link>
      <description>&lt;P&gt;Given your situation, I would advise creating an addin instead and simply storing on a global list the sweep features you create and moving your original script into the CommandCreatedEvent of a button you add to the Fusion360 interface. However, if you want this to still work after relaunching Fusion, what you could do is put an attribute on the features you create so you know which one they are. I would advise against using the indexes of the sweep features because they might change if you manipulate the timeline/delete features.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that doesn't answer your question, please give us a sample code so your workflow is more clear.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 08:00:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/creating-and-referencing-sweep-features-where-pre-existing-sweep/m-p/10974816#M6507</guid>
      <dc:creator>tykapl.breuil</dc:creator>
      <dc:date>2022-02-28T08:00:06Z</dc:date>
    </item>
  </channel>
</rss>

