(API) Extracting node table

(API) Extracting node table

Anonymous
Not applicable
2,034 Views
6 Replies
Message 1 of 7

(API) Extracting node table

Anonymous
Not applicable

Hey

 

Is it possible to extract the numbers of all nodes from a model ? Basically I want to extract the Node table from Robot into an excel spreadsheet incl. numbers and coordinates, support conditions are not important right now. How would the code look like in VBA?

 

I have the macro that extract and modify the coordinates of the model, but I need the nodes and their coord. together. 

 

Thanks in advance

 

0 Likes
Accepted solutions (1)
2,035 Views
6 Replies
Replies (6)
Message 2 of 7

Rafal.Gaweda
Autodesk Support
Autodesk Support
Sorry I do not understand.
You have the macro but want the same macro again in "different way" ?


Rafal Gaweda
0 Likes
Message 3 of 7

Anonymous
Not applicable

Sorry for the comfusion. I just want to extract the Node table from a ROBOT model to excel via a code in VBA.

0 Likes
Message 4 of 7

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution
 Dim NodeCol As RobotNodeCollection
    Set NodeCol = RobApp.Project.Structure.Nodes.GetAll
    Dim RNode As RobotNode
 
    
    For ii = 1 To NodeCol.Count

        Cells(Row, 1) = "Node"
        Set RNode = NodeCol.Get(ii)
        Cells(Row, 2) = RNode.Number
        Cells(Row, 4) = RNode.X
        Cells(Row, 5) = RNode.Y
        Cells(Row, 6) = RNode.Z
        
        Row = Row + 1
    Next ii


Rafal Gaweda
0 Likes
Message 5 of 7

Anonymous
Not applicable

Thanks that worked.

0 Likes
Message 6 of 7

Anonymous
Not applicable

Hi, I was just looking to extract node table for selected panels only. Can anyone guide me to get it for perticular panels.

 

Thanks in advance.

0 Likes
Message 7 of 7

Rafal.Gaweda
Autodesk Support
Autodesk Support

Example (panel selection should be made in Robot)

 

    Dim PanelSel As RobotSelection
    Set PanelSel = RobApp.Project.Structure.Selections.Get(I_OT_PANEL)
    
    Dim Panel As RobotObjObject
    Dim PanelCol As RobotObjObjectCollection
    Set PanelCol = RobApp.Project.Structure.Objects.GetMany(PanelSel)
    
    Dim NodesSelection As String
    NodesSelection = ""
    
    For i = 1 To PanelCol.Count
        Set Panel = PanelCol.Get(i)
        NodesSelection = NodesSelection + " " + Panel.Nodes
    Next i
    
    Dim NodeSel As RobotSelection
    Set NodeSel = RobApp.Project.Structure.Selections.Create(I_OT_NODE)
    NodeSel.FromText NodesSelection
    
    Dim NodeCol As RobotNodeCollection
    Set NodeCol = RobApp.Project.Structure.Nodes.GetMany(NodeSel)
    Dim RNode As RobotNode
 
    Row = 10
    For ii = 1 To NodeCol.Count

        Cells(Row, 1) = "Node"
        Set RNode = NodeCol.Get(ii)
        Cells(Row, 2) = RNode.Number
        Cells(Row, 4) = RNode.X
        Cells(Row, 5) = RNode.Y
        Cells(Row, 6) = RNode.Z
        
        Row = Row + 1
    Next ii


Rafal Gaweda
0 Likes