<?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: Failed to add a new workspace in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6398501#M19696</link>
    <description>&lt;P&gt;Hi Marshal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!! It works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW the API documentation does not indicate that we should use a specific product type like this, it is better to write it down all the details in the manual. I spent a lot of time to play with this simple functions. There is no way we can guess. No error message Just return null is really hard to figure out the problem. Hope you guys can improve it. &amp;nbsp;thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 16:55:00 GMT</pubDate>
    <dc:creator>lsRDZZQ</dc:creator>
    <dc:date>2016-06-22T16:55:00Z</dc:date>
    <item>
      <title>Failed to add a new workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6397081#M19694</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to add a new workspace by calling&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ptr&amp;lt;Workspace&amp;gt; wspace= workspaces-&amp;gt;add("NewWSpace", "NewWSpaceID",&amp;nbsp;"NewWSpace", "./icon");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But wspace is always null. What should I do? Thanks!&lt;/P&gt;&lt;P&gt;The two png icons are under ./icon directory.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 23:22:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6397081#M19694</guid>
      <dc:creator>lsRDZZQ</dc:creator>
      <dc:date>2016-06-21T23:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add a new workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6397205#M19695</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looked the product type you gave was not valid. Please give a try for the Python sample codes as below and see if it works or in your side?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#Author-
#Description-

import adsk.core, adsk.fusion, adsk.cam, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface

        ui.workspaces.add(app.activeProduct.productType, 'NewWSpaceID', 'NewWSpace', '')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 01:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6397205#M19695</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2016-06-22T01:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add a new workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6398501#M19696</link>
      <description>&lt;P&gt;Hi Marshal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!! It works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW the API documentation does not indicate that we should use a specific product type like this, it is better to write it down all the details in the manual. I spent a lot of time to play with this simple functions. There is no way we can guess. No error message Just return null is really hard to figure out the problem. Hope you guys can improve it. &amp;nbsp;thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 16:55:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6398501#M19696</guid>
      <dc:creator>lsRDZZQ</dc:creator>
      <dc:date>2016-06-22T16:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add a new workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6399577#M19697</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the suggestion. We will improve documentation for the API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: in C++, Application::getLastError() api will help give more error information once you cannot get expected result from some specific API. For Python and Javascript, an exception error message would pop up directly if the API call fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, Application::supportedProductTypes() will give a list of product types.&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;</description>
      <pubDate>Thu, 23 Jun 2016 05:41:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6399577#M19697</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2016-06-23T05:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to add a new workspace</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6399669#M19698</link>
      <description>&lt;P&gt;Marshal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Glad to know that there is a function to get the error message. thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 06:53:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/failed-to-add-a-new-workspace/m-p/6399669#M19698</guid>
      <dc:creator>lsRDZZQ</dc:creator>
      <dc:date>2016-06-23T06:53:13Z</dc:date>
    </item>
  </channel>
</rss>

