<?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: Creating Panel with Python win32com/API in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616008#M21907</link>
    <description>&lt;P&gt;You need obj.Update in the end&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2020 07:21:11 GMT</pubDate>
    <dc:creator>kai-hung.changHSCJ3</dc:creator>
    <dc:date>2020-07-03T07:21:11Z</dc:date>
    <item>
      <title>Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9166903#M21901</link>
      <description>&lt;P&gt;After browsing tons of reference codes, I still can't find a way to create panels using API under Python. Could you please provide some pseudo code how to create a panel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I think it should look like based on what I learned&lt;/P&gt;&lt;P&gt;# Let's say the contour c is predefined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;panelid= RobApp.Project.Structure.Objects.FreeNumber&lt;BR /&gt;panel = RobApp.Project.Structure.Objects.Create(panelid)&lt;/P&gt;&lt;P&gt;panel.Main.Geometry = c&lt;/P&gt;&lt;P&gt;panel.StructuralType = 0&amp;nbsp; # for panel&lt;/P&gt;&lt;P&gt;panel.AnalyzeTTMethod = True&lt;/P&gt;&lt;P&gt;panel.SetLabel(I_LT_PANEL_THICKNESS, "thickness_name")&lt;/P&gt;&lt;P&gt;panel.SetLabel(I_LT_PANEL_CALC_MODEL, "calcmodel_name")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the above correct? Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, a huge blocker is to create new instance of a class. In Excel VBA, I see people simply do&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim contour As New RobotGeoContour&lt;/P&gt;&lt;P&gt;How can python do the same thing using win32com? I can't even find IRobotGeoObject class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help! Really appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 09:37:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9166903#M21901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-26T09:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9175852#M21902</link>
      <description>&lt;P&gt;I figured the solution myself.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create a new class instance defined in the API using win32com and Python, one has to do the followings:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;Windows Start -&amp;gt; run regedit (Registry Editor)-&amp;gt; HKEY_CLASSES_ROOT : Here shows all the names of COM objects, such as Robot.GeoContour&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;In the Python code, the class instance should be declared as:&amp;nbsp; &amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;contour = win32.DispatchEx("Robot.GeoContour")&amp;nbsp;&lt;/P&gt;&lt;P&gt;# DispatchEx ensures having duplicate COM object instances if you want to create multiple class instances&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>Sun, 01 Dec 2019 17:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9175852#M21902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-01T17:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9615973#M21903</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am also using Win32com and python interface. But i have problem with creating the contour c .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was my code . But after i run it i dont see a object in my software.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am i creating a geo contour wrong ? or&amp;nbsp; (obj.Main.Geometry = c) is it right&amp;nbsp;??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;c= RobotAPILib.IRobotGeoContour&lt;BR /&gt;Segment = RobotAPILib.RobotGeoSegmentLine()&lt;/P&gt;&lt;P&gt;Segment.P1.Set(0,0,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(10,0,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(10,10,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(0,10,0)&lt;BR /&gt;c.Add(Segment)&lt;/P&gt;&lt;P&gt;c.Initialize&lt;BR /&gt;obj.Main.Geometry = c&lt;BR /&gt;obj.Main.Attribs.Meshed = True&lt;BR /&gt;# obj.SetLabel(robconst.I_LT_PANEL_THICKNESS, SlabSectionName)&lt;BR /&gt;obj.Initialize&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you dont mind can you share me the code for your contour c. it will help me a lot&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:05:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9615973#M21903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-03T07:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9615984#M21904</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;def &lt;/SPAN&gt;&lt;SPAN&gt;create_panel&lt;/SPAN&gt;(segments_in_meter&lt;SPAN&gt;, &lt;/SPAN&gt;if_edge_x_is_longer):&lt;BR /&gt;    &lt;SPAN&gt;# windows Start -&amp;gt; regedit -&amp;gt; HKEY_CLASSES_ROOT (All the names of COM objects)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    # Have to use DispatchEx to&lt;BR /&gt;&lt;/SPAN&gt;    contour = win32.DispatchEx(&lt;SPAN&gt;"Robot.GeoContour"&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;s &lt;SPAN&gt;in &lt;/SPAN&gt;segments_in_meter:&lt;BR /&gt;        gsl = win32.DispatchEx(&lt;SPAN&gt;"Robot.GeoSegmentLine"&lt;/SPAN&gt;)&lt;BR /&gt;        gsl.P1.Set(*s)&lt;BR /&gt;        contour.Add(gsl)&lt;BR /&gt;        &lt;SPAN&gt;del &lt;/SPAN&gt;gsl&lt;BR /&gt;    contour.Initialize()&lt;BR /&gt;    panelid = project.Structure.Objects.FreeNumber&lt;BR /&gt;    panel = project.Structure.Objects.Create(panelid)&lt;BR /&gt;    panel.Main.Geometry = contour&lt;BR /&gt;    panel.Main.Attribs.Meshed = &lt;SPAN&gt;True&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;    if &lt;/SPAN&gt;if_edge_x_is_longer:&lt;BR /&gt;        panel.Main.Attribs.SetDirX(&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;else&lt;/SPAN&gt;:&lt;BR /&gt;        panel.Main.Attribs.SetDirX(&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;)&lt;BR /&gt;    panel.StructuralType = &lt;SPAN&gt;0&lt;BR /&gt;&lt;/SPAN&gt;    panel.SetLabel(I_LT_PANEL_THICKNESS&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"ConXTech"&lt;/SPAN&gt;)&lt;BR /&gt;    panel.SetLabel(I_LT_PANEL_CALC_MODEL&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"ConXTech"&lt;/SPAN&gt;)&lt;BR /&gt;    panel.Initialize()&lt;BR /&gt;    panel.Update()&lt;BR /&gt;    &lt;SPAN&gt;del &lt;/SPAN&gt;contour&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:05:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9615984#M21904</guid>
      <dc:creator>kai-hung.changHSCJ3</dc:creator>
      <dc:date>2020-07-03T07:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9615999#M21905</link>
      <description>&lt;P&gt;I created my contour similar to your code. just that you used for loop i wrote line by line.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you verify what is my mistake.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to see the contour in the software after i run the app.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:13:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9615999#M21905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-03T07:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616007#M21906</link>
      <description>&lt;P&gt;Any error message coming out?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:20:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616007#M21906</guid>
      <dc:creator>kai-hung.changHSCJ3</dc:creator>
      <dc:date>2020-07-03T07:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616008#M21907</link>
      <description>&lt;P&gt;You need obj.Update in the end&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:21:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616008#M21907</guid>
      <dc:creator>kai-hung.changHSCJ3</dc:creator>
      <dc:date>2020-07-03T07:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616044#M21908</link>
      <description>&lt;P&gt;This is my code .. I dont see any error message&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i dont see contour or slab in application.&amp;nbsp; Can you help please&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import win32com.client&lt;BR /&gt;import RobotAPI_Py_lib as RobotAPILib&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# instantiates RobotApplication&lt;BR /&gt;robapp = win32com.client.Dispatch("Robot.Application")&lt;BR /&gt;# constant type library created when Dispatch is run&lt;BR /&gt;robconst = win32com.client.constants&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Visualisation and Control&lt;BR /&gt;robapp.Visible = True&lt;BR /&gt;robapp.Interactive = True&lt;BR /&gt;robapp.Window.Activate&lt;BR /&gt;robapp.Project.ViewMngr.Refresh&lt;/P&gt;&lt;P&gt;# creates instance of project (only one allowed)&lt;BR /&gt;robapp.Project.New(robconst.I_PT_FRAME_3D)&lt;BR /&gt;S = RobotAPILib.RobotStructure&lt;BR /&gt;S = robapp.Project.Structure&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Label Creation for cross sections&lt;BR /&gt;labels = RobotAPILib.RobotLabelServer&lt;BR /&gt;labels = robapp.Project.Structure.Labels&lt;/P&gt;&lt;P&gt;# Naming the Slab and Assigning properties of Slab&lt;BR /&gt;SlabSectionName = "Slab"&lt;BR /&gt;Slab_Label = labels.Create(robconst.I_LT_PANEL_THICKNESS, SlabSectionName)&lt;BR /&gt;thickness = RobotAPILib.RobotThicknessData&lt;BR /&gt;thickness = Slab_Label.Data&lt;BR /&gt;thickness.MaterialName = "MAT1111"&lt;BR /&gt;thickness.ThicknessType = robconst.I_TT_HOMOGENEOUS # For Isotropic&lt;BR /&gt;thicknessData = RobotAPILib.RobotThicknessHomoData&lt;BR /&gt;thicknessData = thickness.Data&lt;BR /&gt;thicknessData.ThickConst = 1&lt;BR /&gt;labels.Store(Slab_Label)&lt;/P&gt;&lt;P&gt;# Creating the Slab Object&lt;BR /&gt;obj_server = RobotAPILib.RobotObjObjectServer()&lt;BR /&gt;obj_server = S.Objects&lt;BR /&gt;objNumber = obj_server.FreeNumber&lt;/P&gt;&lt;P&gt;obj = RobotAPILib.RobotObjObject()&lt;BR /&gt;obj = obj_server.Create(1)&lt;/P&gt;&lt;P&gt;c= RobotAPILib.RobotGeoContour()&lt;BR /&gt;Segment = RobotAPILib.RobotGeoSegmentLine()&lt;/P&gt;&lt;P&gt;Segment.P1.Set(0,0,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(10,0,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(10,10,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(0,10,0)&lt;BR /&gt;c.Add(Segment)&lt;/P&gt;&lt;P&gt;c.Initialize()&lt;BR /&gt;obj.Main.Geometry = c&lt;BR /&gt;obj.Main.Attribs.Meshed = True&lt;BR /&gt;obj.SetLabel(robconst.I_LT_PANEL_THICKNESS, SlabSectionName)&lt;BR /&gt;obj.Initialize()&lt;BR /&gt;obj.Update()&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:43:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616044#M21908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-03T07:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616049#M21909</link>
      <description>&lt;P&gt;&amp;nbsp;I think there is a mistake with the way i add segments but i couldnt figureout what it is&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:45:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616049#M21909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-03T07:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616054#M21910</link>
      <description>&lt;P&gt;What looks suspicious to me are these:&lt;/P&gt;&lt;P&gt;obj_server = RobotAPILib.RobotObjObjectServer()&lt;BR /&gt;obj_server = S.Objects&lt;BR /&gt;objNumber = obj_server.FreeNumber&lt;/P&gt;&lt;P&gt;obj = RobotAPILib.RobotObjObject()&lt;BR /&gt;obj = obj_server.Create(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or another possible bug is here:&lt;/P&gt;&lt;P&gt;Segment = RobotAPILib.RobotGeoSegmentLine()&lt;/P&gt;&lt;P&gt;Segment.P1.Set(0,0,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(10,0,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(10,10,0)&lt;BR /&gt;c.Add(Segment)&lt;BR /&gt;Segment.P1.Set(0,10,0)&lt;BR /&gt;c.Add(Segment)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code, I create a new GeoSegmentLine in each for loop. Maybe you can try the same thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:50:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616054#M21910</guid>
      <dc:creator>kai-hung.changHSCJ3</dc:creator>
      <dc:date>2020-07-03T07:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616067#M21911</link>
      <description>The initializations are slightly different between you and me.&lt;BR /&gt;&lt;BR /&gt;Instead of writing project.structure.objects every time i created a variables .&lt;BR /&gt;where&lt;BR /&gt;S = project.structure&lt;BR /&gt;&lt;BR /&gt;obj_server = project.structure.objects&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Jul 2020 07:53:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9616067#M21911</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-03T07:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9619020#M21912</link>
      <description>&lt;P&gt;The code worked when i deleted segment every time before i add a contour segment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the assist&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 04:46:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/9619020#M21912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-06T04:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Panel with Python win32com/API</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/12400935#M21913</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How to install RobotAPI_Py_lib?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Nov 2023 11:54:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/creating-panel-with-python-win32com-api/m-p/12400935#M21913</guid>
      <dc:creator>alexander.silvaGA9XG</dc:creator>
      <dc:date>2023-11-26T11:54:35Z</dc:date>
    </item>
  </channel>
</rss>

