Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open node table by vba macro

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
kamil.bednarek6U58T
354 Views, 5 Replies

Open node table by vba macro

Hi,

I have to open 5 tables in hundred of files every day so maybe someone know the way how to open specyfic tables by using the button in excel. 

I would be extremely grateful.

🙂

Tags (3)
5 REPLIES 5
Message 2 of 6

You can search the Forum and you will get a lot of info regarding this subject.

Try this and see if it helps you

 

    Dim RobApp As IRobotApplication
    Set RobApp = New RobotApplication
    
    ' open one model
    Dim MyPath As String
    MyPath = "c:\lixo\RS.rtd"                    'Put your path or loop
    RobApp.Project.Open MyPath

    ' Create Node Table
    Dim rt As IRobotTable
    Set rt = RobApp.Project.ViewMngr.CreateTable(I_TT_NODES, I_TDT_NODE)
    rt.Select I_ST_NODE, "all"

    rt.AddColumn (0) 'X
    rt.AddColumn (1) 'Y
    rt.AddColumn (2) 'Z

    Dim OutPath
    OutPath = "c:\lixo\RS.txt"                   'Put your path or loop
    rt.Printable.SaveToFile OutPath, I_OFF_TEXT
    Set RobApp = Nothing

 

 Regards

Message 3 of 6

I'm sorry i caused confusion. I would like to open table window in robot program, without clicking right mouse button and pick Node, Bar tables. I would like to click in excel one button and Five different tables will open in my tab.

On the bottom of the screen:

View | Nodes | Reactions | Bars | Loads | Combinations   <--- these are tabs

Message 4 of 6

I don't want this tables in excel.

I want it here:

kamilbednarek6U58T_0-1715594447953.png

 Maybe there is some setting file, where we can adjust tables which open automatically when program is opening.

 

Message 5 of 6

I have a old version of RSA and there is some issue with tables creation by API and View Manager that is responsible for those tabs.

    Set RobApp = New RobotApplication
   
    ' Create Node Table
    Dim rt As IRobotTable
    Set rt = RobApp.Project.ViewMngr.CreateTable(I_TT_NODES, I_TDT_NODE)
    rt.Select I_ST_NODE, "all"
    ' check wich columns do you need
    rt.AddColumn (0)
    rt.AddColumn (1)
    rt.AddColumn (2)
    
    rt.Window.State = I_WS_NORMAL
    rt.Visible = True
    rt.UserControl = True


    Set rt = RobApp.Project.ViewMngr.CreateTable(I_TT_BARS, I_TDT_BAR)
    rt.Select I_ST_BAR, "all"
    ' check wich columns do you need
    rt.AddColumn (10)
    rt.AddColumn (11)
    rt.AddColumn (12)
    
    rt.Window.State = I_WS_NORMAL
    rt.Visible = True
    rt.UserControl = True


Set RobApp = Nothing

 After running this code, if you go to window menu and choose cascade you can see the tables are open but don't appear on those tabs. 

 

Maybe someone can give more insights in this problem or even have a solution. 

 

Regards

Message 6 of 6

hi @kamil.bednarek6U58T 

try this 

Private Sub OpeningSeveralTablesInRobot()
  Dim RobApp As RobotApplication
  Set RobApp = New RobotApplication

  For Each Tbl In Array(IRobotTableType.I_TT_NODES, _
                        IRobotTableType.I_TT_BARS, _
                        IRobotTableType.I_TT_COMBINATIONS)
    
    RobApp.Project.ViewMngr.CreateTable Tbl, I_TDT_DEFAULT
  Next

  Set RobApp = Nothing
End Sub

Best Regards

Tags (3)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report