<?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) to select all the node in the top level in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268802#M850</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;Your declaration is not clear. You indicate that you want the nodes to be at the top of each storey;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;however, You have named your variable storeyHeight instead of TopLevelOfStorey.&lt;/LI&gt;
&lt;LI&gt;You indicate that you want a selection, but you're actually setting up a collection.&lt;/LI&gt;
&lt;LI&gt;To avoid multiple iterations, you should test all floor levels against the elevation of each node.&lt;/LI&gt;
&lt;LI&gt;If your building is made up of several floors, don't these floors already include all the nodes you want?&lt;/LI&gt;
&lt;LI&gt;At each iteration, you recreate the nodeServer.GetAll() collection to obtain the node's Z coordinate using the Get method.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;It's difficult to answer your question because we don't know the type of structure you want to scan with your algorithm, let alone the purpose of selecting nodes by storeys. We would need to see the code preceding and following the snippet you shared.&lt;/P&gt;
&lt;P&gt;see also :&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12892327" target="_blank" rel="noopener"&gt;VBA to Get Storey name for the selected Bar&lt;/A&gt;,&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-list-of-nodes-by-strorey/m-p/9194917" target="_blank" rel="noopener"&gt;(API) - List of nodes by Strorey&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
    <pubDate>Sat, 08 Nov 2025 19:09:36 GMT</pubDate>
    <dc:creator>Stephane.kapetanovic</dc:creator>
    <dc:date>2025-11-08T19:09:36Z</dc:date>
    <item>
      <title>(API) to select all the node in the top level</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268759#M849</link>
      <description>&lt;P&gt;hello,&lt;BR /&gt;I want to know is there a better way to get all the node in the top level of stories, im doing this to apply to it a rigid link&lt;BR /&gt;the way I'm using is to check all the node in the project than compare them to the&amp;nbsp;Height of the level desired witch is time consuming,&amp;nbsp;&lt;/P&gt;&lt;P&gt;' Find all nodes at the same elevation (storeyHeight)&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim nodesAtElevation As Collection
Set nodesAtElevation = New Collection
For j = 1 To nodeServer.GetAll().Count
Dim node As IRobotNode
Set node = nodeServer.GetAll().Get(j)
If Abs(node.Z - storeyHeight) &amp;lt; 0.001 Then
nodesAtElevation.Add node.Number
End If
Next j&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;i was looking for Selecting method that does by&amp;nbsp;Storeys.Selection or something like this but I cant find another way&lt;/P&gt;&lt;P&gt;if anyone have better idea it will be very helpful&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2025 07:07:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268759#M849</guid>
      <dc:creator>WALIDGIO</dc:creator>
      <dc:date>2025-01-18T07:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: (API) to select all the node in the top level</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268802#M850</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;Your declaration is not clear. You indicate that you want the nodes to be at the top of each storey;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;however, You have named your variable storeyHeight instead of TopLevelOfStorey.&lt;/LI&gt;
&lt;LI&gt;You indicate that you want a selection, but you're actually setting up a collection.&lt;/LI&gt;
&lt;LI&gt;To avoid multiple iterations, you should test all floor levels against the elevation of each node.&lt;/LI&gt;
&lt;LI&gt;If your building is made up of several floors, don't these floors already include all the nodes you want?&lt;/LI&gt;
&lt;LI&gt;At each iteration, you recreate the nodeServer.GetAll() collection to obtain the node's Z coordinate using the Get method.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;It's difficult to answer your question because we don't know the type of structure you want to scan with your algorithm, let alone the purpose of selecting nodes by storeys. We would need to see the code preceding and following the snippet you shared.&lt;/P&gt;
&lt;P&gt;see also :&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/vba-to-get-storey-name-for-the-selected-bar/m-p/12892327" target="_blank" rel="noopener"&gt;VBA to Get Storey name for the selected Bar&lt;/A&gt;,&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-list-of-nodes-by-strorey/m-p/9194917" target="_blank" rel="noopener"&gt;(API) - List of nodes by Strorey&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2025 19:09:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268802#M850</guid>
      <dc:creator>Stephane.kapetanovic</dc:creator>
      <dc:date>2025-11-08T19:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: (API) to select all the node in the top level</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268876#M851</link>
      <description>&lt;P&gt;thank you stephane for your response&amp;nbsp;&lt;BR /&gt;here my code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'' Create new rigid links
Sub CreateNewRigidLinks()
    Dim robApp As IRobotApplication
    Dim storeyMngr As RobotStoreyMngr
    Dim rigidLinkServer As IRobotNodeRigidLinkServer
    Dim nodeServer As IRobotNodeServer
    Dim nodeDisplacementServer As RobotNodeDisplacementServer

    Dim i As Integer, j As Integer
    Dim newNodeNumber As Long
    Dim storeyCount As Integer

    ' Create a rigid link label
    Dim labelLink As IRobotLabel
    Dim RigidLinkLabel As String
    RigidLinkLabel = "WalidBouzRigidLink"
    Set labelLink = robApp.Project.Structure.Labels.Create(I_LT_NODE_RIGID_LINK, RigidLinkLabel)
    
    ' Set rigid link properties (parameterized)
    Dim RLdata As IRobotNodeRigidLinkData
    Set RLdata = labelLink.Data
    RLdata.UX = True
    RLdata.UY = True
    RLdata.UZ = False
    RLdata.rx = False
    RLdata.ry = False
    RLdata.RZ = True

    ' Store the label
    robApp.Project.Structure.Labels.Store labelLink

    ' Initialize storey count
    storeyCount = 0
    ' Loop through each storey
    For i = 1 To storeyMngr.Count
        Dim storeyHeight As Double
        storeyHeight = storeyMngr.Get(i).TopLevel

        ' Retrieve the storey's reference point (G.X, G.Y)
        Dim Gx As Double, Gy As Double
        Gx = robApp.Project.Structure.Results.Storeys.values(i, 1).G.X
        Gy = robApp.Project.Structure.Results.Storeys.values(i, 1).G.Y

        ' Find all nodes at the same elevation (storeyHeight)
        Dim nodesAtElevation As Collection
        Set nodesAtElevation = New Collection
        For j = 1 To nodeServer.GetAll().Count
            Dim node As IRobotNode
            Set node = nodeServer.GetAll().Get(j)
            If Abs(node.Z - storeyHeight) &amp;lt; 0.001 Then
                nodesAtElevation.Add node.Number
            End If
        Next j

        ' Check if a node already exists at (G.X, G.Y, storeyHeight)
        Dim masterNode As Long
        masterNode = -1 ' Default value if no node is found
        For j = 1 To nodesAtElevation.Count
            Set node = nodeServer.Get(nodesAtElevation(j))
            If Abs(node.X - Gx) &amp;lt; 0.001 And Abs(node.Y - Gy) &amp;lt; 0.001 And Abs(node.Z - storeyHeight) &amp;lt; 0.001 Then
                masterNode = node.Number
                Exit For
            End If
        Next j

        ' If no node exists, create a new master node
        Dim nodeCreation As String
        If masterNode = -1 Then
            masterNode = nodeServer.FreeNumber
            nodeServer.Create masterNode, Gx, Gy, storeyHeight
        Else
            ' Remove the master node from the collection of nodes at the same elevation
            For j = nodesAtElevation.Count To 1 Step -1
                If nodesAtElevation(j) = masterNode Then
                    nodesAtElevation.Remove j
                    Exit For
                End If
            Next j
        End If

        ' Create a rigid link with the master node and nodes at the same elevation
        If nodesAtElevation.Count &amp;gt; 0 Then
            ' Format secondary nodes as a string
            Dim secondaryNodesStr As String
            secondaryNodesStr = ""
            For j = 1 To nodesAtElevation.Count
                secondaryNodesStr = secondaryNodesStr &amp;amp; nodesAtElevation(j) &amp;amp; " "
            Next j
            
            ' Create the rigid link using the stored label
            rigidLinkServer.Set masterNode, secondaryNodesStr, RigidLinkLabel
            ' Increment storey count
            storeyCount = storeyCount + 1
        End If
    Next i
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;1-&amp;nbsp; You’re right, naming it storeyHeight isn’t the clearest choice. I’ll rename it to TopLevelOfStorey to better reflect its purpose. Thanks for pointing that out.&lt;/P&gt;&lt;P&gt;2- You’re right. I was using a Collection to store nodes at the same elevation as a way to group them for further processing. If there’s a more efficient way to directly select nodes by elevation without iterating through all nodes and minimize unnecessary iterations, I’d be glad to learn about it. The goal is to apply rigid links efficiently to nodes at the top level of each storey.&lt;/P&gt;&lt;P&gt;3-&amp;nbsp;Right now, I loop through all nodes and compare their Z coordinate with the top level of each storey. It’s not efficient for large models. Does RSA’s API offer a way to directly query nodes by elevation or storey?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5-this is the correct way you mean&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;        ' Find all nodes at the same elevation (storeyHeight)
        Dim nodesAtElevation As Collection
        Set nodesAtElevation = New Collection
        Set allNodes = nodeServer.GetAll()
        For j = 1 To allNodes.Count
            Dim node As IRobotNode
            Set node = allNodes.Get(j)
            If Abs(node.Z - TopLevelOfStorey) &amp;lt; 0.001 Then
                nodesAtElevation.Add node.Number
            End If
        Next j
        &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6-&amp;nbsp;The structure I’m working on is a multi-storey building. The purpose of the code is to create rigid links between all nodes at the top level of each storey and a single master node.&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>Sat, 18 Jan 2025 09:24:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268876#M851</guid>
      <dc:creator>WALIDGIO</dc:creator>
      <dc:date>2025-01-18T09:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: (API) to select all the node in the top level</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268892#M852</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;a similar subject has already been developed freely&amp;nbsp;&lt;A href="https://apps.autodesk.com/RSA/fr/Detail/Index?id=8768390536116652588&amp;amp;appLang=en&amp;amp;os=Win64" target="_blank" rel="noopener"&gt;https://apps.autodesk.com/RSA/fr/Detail/Index?id=8768390536116652588&amp;amp;appLang=en&amp;amp;os=Win64&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please contact &lt;A class="app-details__publisher-link" href="https://apps.autodesk.com/fr/Publisher/PublisherHomepage?ID=200812230804518" target="_blank" rel="noopener"&gt;&lt;SPAN class="seller"&gt;Roman Zhelezniak&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/559029"&gt;@Romanich&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2025 19:10:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-to-select-all-the-node-in-the-top-level/m-p/13268892#M852</guid>
      <dc:creator>Stephane.kapetanovic</dc:creator>
      <dc:date>2025-11-08T19:10:07Z</dc:date>
    </item>
  </channel>
</rss>

