<?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: VBA  to Get Storey name for the selected Bar in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12893167#M2575</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3743427"&gt;@WALIDGIO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;has mentionned &lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-vba-select-bars-within-storeys-and-retrieve-fx-max/td-p/12887944" target="_blank" rel="noopener"&gt;here&amp;nbsp;&lt;/A&gt;and &lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-find-storey-that-a-element-belongs-to/m-p/8690074" target="_blank" rel="noopener"&gt;link&lt;/A&gt; in message 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's a selection of bars from the "story 1" storey&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim BarSelection As RobotSelection
Set BarSelection = RobApp.Project.Structure.Selections.CreateByStorey(I_OT_BAR, "Story 1")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To find out whether a bar is part of a selection, you can, for example, use "Contains".&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim Bar_To_Find As Long, ExistInSelection As Boolean
Bar_To_Find = 45 ' Bar to find
ExistInSelection = BarSelection.Contains(Bar_To_Find)&lt;/LI-CODE&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 05:59:41 GMT</pubDate>
    <dc:creator>Stephane.kapetanovic</dc:creator>
    <dc:date>2024-07-12T05:59:41Z</dc:date>
    <item>
      <title>VBA  to Get Storey name for the selected Bar</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12892327#M2573</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;is there a way to get the storey name of an element (bar) that I already get, i'm trying to get the force that belong to that bar and output them in Excel, but also i want to add a column of which storey that bar belong to, I'm looking for something like this&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim storeyName As String
storeyName = bar.GetLabelName(I_LT_STOREY(name or label))&lt;/LI-CODE&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;is there a way or i have to iterate through each storey and then put the bar code&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 19:14:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12892327#M2573</guid>
      <dc:creator>WALIDGIO</dc:creator>
      <dc:date>2024-07-11T19:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: VBA  to Get Storey name for the selected Bar</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12892441#M2574</link>
      <description>&lt;P&gt;So far workaround a code by finding the Noed related to that bar then get the Z elevation compared to the storey and get the storey name&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;        For Each bar In bars
            Dim bar_num As Long
            bar_num = bar.Number
            
            barNodeZ = bar.StartNode 
            Dim nodeStart As IRobotNode
            Set nodeStart = robapp.Project.Structure.Nodes.Get(barNodeZ)
            barHeight = nodeStart.Z

            Dim Storeys As RobotStoreyMngr, Storey As RobotStorey
            Set Storeys = robapp.Project.Structure.Storeys

            For S = 1 To Storeys.Count
                Set Storey = Storeys.Get(S)
                If Storey.Level = barHeight Then
                    storeyName = Storey.Name
                    Exit For
                End If
            Next S
....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if there isn't a direct call of storey Label from bar Object, I'll continue with this solution&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 20:29:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12892441#M2574</guid>
      <dc:creator>WALIDGIO</dc:creator>
      <dc:date>2024-07-11T20:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: VBA  to Get Storey name for the selected Bar</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12893167#M2575</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3743427"&gt;@WALIDGIO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;has mentionned &lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-vba-select-bars-within-storeys-and-retrieve-fx-max/td-p/12887944" target="_blank" rel="noopener"&gt;here&amp;nbsp;&lt;/A&gt;and &lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-find-storey-that-a-element-belongs-to/m-p/8690074" target="_blank" rel="noopener"&gt;link&lt;/A&gt; in message 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's a selection of bars from the "story 1" storey&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim BarSelection As RobotSelection
Set BarSelection = RobApp.Project.Structure.Selections.CreateByStorey(I_OT_BAR, "Story 1")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To find out whether a bar is part of a selection, you can, for example, use "Contains".&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim Bar_To_Find As Long, ExistInSelection As Boolean
Bar_To_Find = 45 ' Bar to find
ExistInSelection = BarSelection.Contains(Bar_To_Find)&lt;/LI-CODE&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 05:59:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12893167#M2575</guid>
      <dc:creator>Stephane.kapetanovic</dc:creator>
      <dc:date>2024-07-12T05:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: VBA  to Get Storey name for the selected Bar</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12894354#M2576</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6876621"&gt;@Stephane.kapetanovic&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the replay, I think there&lt;SPAN&gt;&amp;nbsp;is no proprety concerning the storey for a element yet, I thought i was Implemented after all these years, so we still need to worked around&amp;nbsp;&lt;BR /&gt;what i really want is to retrieve the storey of element directly without compare it, or get it from a group of selection.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;like in this picture the bar proprety has a story that it belong to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WALIDGIO_0-1720799180612.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1386161iA88166658370DBE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WALIDGIO_0-1720799180612.png" alt="WALIDGIO_0-1720799180612.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 16:47:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12894354#M2576</guid>
      <dc:creator>WALIDGIO</dc:creator>
      <dc:date>2024-07-12T16:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: VBA  to Get Storey name for the selected Bar</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12894477#M2577</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3743427"&gt;@WALIDGIO&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a request you should make to the Autodesk team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As explained, the suggestions presented here are intended to illustrate the capabilities of the Robot API. They are not necessarily tailored to your specific architecture and are shared as general-purpose usage examples, rather than definitive solutions for a particular or personalized implementation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the use of the RobotBar class and the addition of direct-read properties from&amp;nbsp;RobotStorey, I have a different point of view than changing the paradigm. The code provided consists of just a few lines and is based on selections made from text strings, which are very quick to process compared to some collections. overloading the bar class with properties that are only occasionally read is not ideal.&lt;/P&gt;
&lt;P&gt;Instead, you can optimize access times in your code by better data management, changing your programming language, creating your own classes and parralelizing your queries. This approach would preserve the API's efficiency while allowing for the customization you need.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2026 19:50:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12894477#M2577</guid>
      <dc:creator>Stephane.kapetanovic</dc:creator>
      <dc:date>2026-03-08T19:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: VBA  to Get Storey name for the selected Bar</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12894519#M2578</link>
      <description>&lt;P&gt;Here you'll find an offline method that you can adapt to your own situation.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-get-the-group-that-the-bar-belongs-to-via-api/td-p/12884859" target="_blank"&gt;https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-get-the-group-that-the-bar-belongs-to-via-api/td-p/12884859&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 18:20:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12894519#M2578</guid>
      <dc:creator>Stephane.kapetanovic</dc:creator>
      <dc:date>2024-07-12T18:20:19Z</dc:date>
    </item>
  </channel>
</rss>

