<?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 Robot Dynamo Create New Section and Variable Name Python in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341592#M20877</link>
    <description>&lt;P&gt;You can translate code from VB to Python by online web.As picture&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ans.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/734138iD68E0EA9017855A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ans.jpg" alt="ans.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 04:03:07 GMT</pubDate>
    <dc:creator>napooil</dc:creator>
    <dc:date>2020-02-26T04:03:07Z</dc:date>
    <item>
      <title>API Robot Dynamo Create New Section and Variable Name Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341262#M20876</link>
      <description>&lt;P&gt;Good night,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi, I am a totally noob with the API Robot and all&amp;nbsp; that is related with programing, I started recently.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These days, I have had thousands of doubts but thanks to the forum and looking in the API guide I have been able to figure out it. Is any Python Guide, not for C or C+?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I am trying to create a new section shape but I am not able to do it, even looking in the guide, I dont have a clue how the programming.I am learning taking a look to other examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you transform this lines for a Python script?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example ( API GUIDE):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set Label = Robot.Project.Structure.labels.Create(I_LT_BAR_SECTION, "Beam 50*50")&lt;BR /&gt;Dim section As RobotBarSectionData&lt;BR /&gt;Set section = Label.Data&lt;BR /&gt;section.ShapeType = I_BSST_CONCR_BEAM_RECT&lt;BR /&gt;Dim concrete As RobotBarSectionConcreteData&lt;BR /&gt;Set concrete = section.concrete&lt;BR /&gt;concrete.SetValue I_BSCDV_BEAM_B, 0.5&lt;BR /&gt;concrete.SetValue I_BSCDV_BEAM_H, 0.5&lt;BR /&gt;section.CalcNonstdGeometry&lt;BR /&gt;Robot.Project.Structure.labels.Store Label&lt;BR /&gt;Robot.Project.Structure.Bars.Get(1).SetLabel I_LT_BAR_SECTION, "Beam 50*50"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last doubt, Anyone knows how to do a variable name of the section?, I want to assign different kind of section to different bars and to use a loop.&lt;BR /&gt;for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Beam 50*50_1", the next bar "Beam 50*50_2".... "Beam 50*50_i"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PD: It is my first post, I hope is posted in the right place.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 22:34:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341262#M20876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-25T22:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: API Robot Dynamo Create New Section and Variable Name Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341592#M20877</link>
      <description>&lt;P&gt;You can translate code from VB to Python by online web.As picture&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ans.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/734138iD68E0EA9017855A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ans.jpg" alt="ans.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 04:03:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341592#M20877</guid>
      <dc:creator>napooil</dc:creator>
      <dc:date>2020-02-26T04:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: API Robot Dynamo Create New Section and Variable Name Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341873#M20878</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you need just to add the loop.&lt;/P&gt;&lt;P&gt;make a list of all sections, width and the height.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The base of this code comes from the SDK-&amp;gt;Tutorial map with the example codes.(quite helpfull with the tool&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2390743"&gt;@napooil&lt;/a&gt;&amp;nbsp;shared)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see this code including the loop.(python script inside dynamo)&lt;/P&gt;&lt;PRE&gt;import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object
#The inputs to this node will be stored as a list in the IN variables.
#Define input

USec_name = IN[0]
USec_mat = IN[1]
USec_B = IN[2]
USec_H = IN[3]

application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
ProjectPrefs = project.Preferences
bars = structure.Bars

#User rectangular section
for i in range(len(USec_name)):
	lab_serv = IRobotLabelServer 
	lab_serv = labels
	sec = IRobotLabel
	sec = lab_serv.create(IRobotLabelType.I_LT_BAR_SECTION, USec_name[i])
	data = sec.data
	data.Type = IRobotBarSectionType.I_BST_NS_RECT
	data.ShapeType = IRobotBarSectionShapeType.I_BSST_RECT_FILLED
	nonst_data = IRobotBarSectionNonstdData
	nonst_data = data.CreateNonstd(0)
	nonst_data.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_B,USec_B[i])
	nonst_data.SetValue(IRobotBarSectionNonstdDataValue.I_BSNDV_RECT_H,USec_H[i])
	data.MaterialName = USec_mat[i]
	data.CalcNonstdGeometry
	lab_serv.Store(sec)

OUT = "labels gemaakt"&lt;/PRE&gt;&lt;P&gt;hope this will work for you.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 08:02:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341873#M20878</guid>
      <dc:creator>1234eddie</dc:creator>
      <dc:date>2020-02-26T08:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: API Robot Dynamo Create New Section and Variable Name Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341943#M20879</link>
      <description>&lt;P&gt;Thanks very much!! You made my day&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 08:36:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9341943#M20879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-26T08:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: API Robot Dynamo Create New Section and Variable Name Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9348865#M20880</link>
      <description>&lt;P&gt;In the line of the&amp;nbsp;&lt;/P&gt;&lt;P&gt;:data.&lt;SPAN&gt;CalcNonstdGeometry&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The brackets are missed, should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data.&lt;SPAN&gt;CalcNonstdGeometry()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PD:I am just saying it, in case of someone will use the code.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 16:35:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9348865#M20880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-28T16:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: API Robot Dynamo Create New Section and Variable Name Python</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9349262#M20881</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;&lt;P&gt;youre right. I experienced it that it didn't work without them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am i correct if i say you just need to activate the command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gr edward.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 19:13:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-dynamo-create-new-section-and-variable-name-python/m-p/9349262#M20881</guid>
      <dc:creator>1234eddie</dc:creator>
      <dc:date>2020-02-28T19:13:12Z</dc:date>
    </item>
  </channel>
</rss>

