<?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 Create 2D Setup without Model in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12841676#M1261</link>
    <description>&lt;P&gt;I am trying to create a setup for 2D toolpaths that use only sketches, without any 3D models.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script works perfectly in automatically producing all of my toolpaths from templates, using sketch geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My only problem is the annoying warning: "Model: No model selected. All models/solids will be used."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I notice that if I subsequently edit the setup and select either the "Cam Root" component or the "CAM Component:1" component, the warning goes away, with absolutely no impact on my toolpaths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The docs say that setup.model can be set to an occurrence, but I can't find a way to access occurrences for either of these components.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using&amp;nbsp;&lt;SPAN&gt;camProd.designRootOccurrence, but that throws an error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've read that I should ALWAYS set a model in the setup, which I do when I have bodies, but what to do if I have no bodies (and I don't want to create fake bodies or material bodies simply to avoid this warning).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This must be easy, but in my script I can't find the occurrences that obviously exist for these two components (because the UI allows selection of them).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bill&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: All of my toolpaths have the same warning, even though they all generated perfectly and, because they are 2D, don't even have the ability to select a model.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jun 2024 14:30:54 GMT</pubDate>
    <dc:creator>billostratum</dc:creator>
    <dc:date>2024-06-15T14:30:54Z</dc:date>
    <item>
      <title>Create 2D Setup without Model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12841676#M1261</link>
      <description>&lt;P&gt;I am trying to create a setup for 2D toolpaths that use only sketches, without any 3D models.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script works perfectly in automatically producing all of my toolpaths from templates, using sketch geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My only problem is the annoying warning: "Model: No model selected. All models/solids will be used."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I notice that if I subsequently edit the setup and select either the "Cam Root" component or the "CAM Component:1" component, the warning goes away, with absolutely no impact on my toolpaths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The docs say that setup.model can be set to an occurrence, but I can't find a way to access occurrences for either of these components.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using&amp;nbsp;&lt;SPAN&gt;camProd.designRootOccurrence, but that throws an error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've read that I should ALWAYS set a model in the setup, which I do when I have bodies, but what to do if I have no bodies (and I don't want to create fake bodies or material bodies simply to avoid this warning).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This must be easy, but in my script I can't find the occurrences that obviously exist for these two components (because the UI allows selection of them).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bill&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note: All of my toolpaths have the same warning, even though they all generated perfectly and, because they are 2D, don't even have the ability to select a model.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 14:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12841676#M1261</guid>
      <dc:creator>billostratum</dc:creator>
      <dc:date>2024-06-15T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create 2D Setup without Model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12842695#M1262</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14501764"&gt;@billostratum&lt;/a&gt;&amp;nbsp;-San.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know if this will affect you later, but why don't you try setting root.xYConstructionPlane?&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;# Fusion360API Python script

import traceback
import adsk.core as core
import adsk.fusion as fusion
import adsk.cam as cam

def run(context):
    ui: core.UserInterface = None
    try:
        app: core.Application = core.Application.get()
        ui = app.userInterface

        camObj: cam.CAM = app.activeProduct

        setups: cam.Setups = camObj.setups
        setupIpt: cam.SetupInput = setups.createInput(
            cam.OperationTypes.MillingOperation
        )

        # set root.xYConstructionPlane
        rootOcc: fusion.Occurrence = camObj.designRootOccurrence
        setupIpt.models = [rootOcc.component.xYConstructionPlane]
        setup: cam.Setup = setups.add(setupIpt)

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;
&lt;P&gt;I think the best way is to create a 3D model.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 14:46:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12842695#M1262</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2024-06-16T14:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create 2D Setup without Model</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12844575#M1263</link>
      <description>&lt;P&gt;Thanks for your response. Turns out I was setting .models to the singular designRootOcurrence. Your sample led me to change that to an array. That worked.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;setupInput.models = [camProd.designRootOccurrence]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 15:50:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/create-2d-setup-without-model/m-p/12844575#M1263</guid>
      <dc:creator>billostratum</dc:creator>
      <dc:date>2024-06-17T15:50:33Z</dc:date>
    </item>
  </channel>
</rss>

