<?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: API-new project creation Python in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9614294#M19593</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use Robot API via python but I am struggling to use the data defined by Robot Object Model. I looked at SDK and I understand that the robotom.tlb needs to be added to the python IDE. Could you explain how did you manage to do that?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jul 2020 11:40:47 GMT</pubDate>
    <dc:creator>golkrz</dc:creator>
    <dc:date>2020-07-02T11:40:47Z</dc:date>
    <item>
      <title>API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9489538#M19589</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already used the Robot API through VBA and I am not trying to replicate some work with Python (I am relatively new to Python). I followed the methodology suggested here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-amp-ironpython/m-p/7221364" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-amp-ironpython/m-p/7221364&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;and it works perfectly in terms of establishing the connection to Robot. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;However, I was wondering what is the syntax for a new project creation as where I try to set up a new Project using the I_PT_SHELL example in the SDK documentation I cannot seem to get the syntax right.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I defined Robot as in the post above and tried the following syntax structures:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Robot.Project.New('I_PT_SHELL')&lt;/LI-CODE&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;&lt;LI-CODE lang="general"&gt;Robot.Project.New("I_PT_SHELL")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I ask you if you could advise in this regard?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 10:39:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9489538#M19589</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-04T10:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9490299#M19590</link>
      <description>&lt;P&gt;Quick update: I was also trying to run fully the script in the post of my initial question but I receive this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 635px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/764785iB18E9B8D21044D52/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;has anyone else experienced this before?&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 15:10:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9490299#M19590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-04T15:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9496556#M19591</link>
      <description>&lt;P&gt;That must be because there is no open document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to add a line to create a document:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;from RobotOM import IRobotProjectType

project.New(IRobotProjectType.I_PT_SHELL)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 15:22:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9496556#M19591</guid>
      <dc:creator>JacquesGaudin</dc:creator>
      <dc:date>2020-05-06T15:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9496594#M19592</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7613523"&gt;@JacquesGaudin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes, that was also my understanding but I could not get the syntax right. I was using the same format of the label creation but clearly it was not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;P&gt;It might have been a trivial question, but I am a bit new to Python...thanks again!!&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 15:32:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9496594#M19592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-06T15:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9614294#M19593</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use Robot API via python but I am struggling to use the data defined by Robot Object Model. I looked at SDK and I understand that the robotom.tlb needs to be added to the python IDE. Could you explain how did you manage to do that?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2020 11:40:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9614294#M19593</guid>
      <dc:creator>golkrz</dc:creator>
      <dc:date>2020-07-02T11:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9614342#M19594</link>
      <description>&lt;P&gt;For plain CPython:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to install&amp;nbsp;&lt;A href="https://github.com/pythonnet/pythonnet" target="_blank" rel="noopener"&gt;PythonNet&lt;/A&gt;&amp;nbsp;and add a reference to `interop.RobotOM.dll`&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import clr
from pathlib import Path

p = Path('c:/Program Files/Autodesk')
robot_dll_path = str(next(p.rglob('System/EXE/interop.RobotOM.dll')))

clr.AddReference(robot_dll_path)

import RobotOM&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For IronPython:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import clr

robotom_path = "C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2019\System\Exe\interop.RobotOM.dll"
clr.AddReferenceToFileAndPath(robotom_path)

import RobotOM&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in both cases to create an instance of Robot application:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;app = RobotOM.RobotApplication()&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Jul 2020 12:04:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/9614342#M19594</guid>
      <dc:creator>JacquesGaudin</dc:creator>
      <dc:date>2020-07-02T12:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/10107078#M19595</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the snap shot below you can see that there is no attribute as "AddReference", but in all the code above it is there please help ..&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RANGREJ98_0-1614141406398.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/884746i6FA6265C19907277/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RANGREJ98_0-1614141406398.png" alt="RANGREJ98_0-1614141406398.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 04:39:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/10107078#M19595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T04:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/10107561#M19596</link>
      <description>&lt;P&gt;What's the output of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import clr
dir(clr)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Feb 2021 09:21:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/10107561#M19596</guid>
      <dc:creator>JacquesGaudin</dc:creator>
      <dc:date>2021-02-24T09:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: API-new project creation Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/11954100#M19597</link>
      <description>&lt;P&gt;&lt;A href="https://pypi.org/project/pythonnet/" target="_blank" rel="noopener"&gt;Python.Net package&lt;/A&gt; aliases to 'clr', which is in conflict with &lt;A href="https://pypi.org/project/clr/" target="_blank" rel="noopener"&gt;'clr' package&lt;/A&gt;. As stated by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7613523"&gt;@JacquesGaudin&lt;/a&gt;&amp;nbsp;, you can check whether 'clr' is pointing to 'pythonnet' or to 'clr' using 'dir()' function.&lt;/P&gt;&lt;P&gt;To install 'pythonnet' run the following commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;pip uninstall clr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;pip install pythonnet&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this &lt;A href="https://stackoverflow.com/questions/47913079/python-attributeerror-module-object-has-no-attribute-addreference" target="_blank" rel="noopener"&gt;topic&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 11:29:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-new-project-creation-python/m-p/11954100#M19597</guid>
      <dc:creator>mmaso64U7Y</dc:creator>
      <dc:date>2023-05-10T11:29:33Z</dc:date>
    </item>
  </channel>
</rss>

