Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

Select simple cases when printing tables

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Jelle.Visser
483 Views, 8 Replies

Select simple cases when printing tables

I'm trying to select only the simple cases before I print my reaction forces to csv.

However, reading through the documentation, I do find options to create cases, but I do not find a way to select a case for a table. I loop through the tables, and certain ones are "printed" to csv. However, now Reactions are all cases, I only want simple cases.

 

I tried to implement a solution given by @Stephane.kapetanovic

https://forums.autodesk.com/t5/robot-structural-analysis-forum/api-robot-vba-activate-or-select-load...

 

However, this does not seem to work. I would prefer to just the loadcase just for one table, because for the stresses and ratios I do want the combinations to be included.

                    Dim ViewMngr As IRobotViewMngr
                    Dim ActiveView As RobotView
                    Dim CaseSel As RobotSelection
                    Dim ActiveViewNumber As Long
                    ViewMngr = RobApp.Project.ViewMngr
                    For k = 1 To ViewMngr.ViewCount
                        If ViewMngr.GetView(k).Window.IsActive = -1 Then ActiveViewNumber = k : Exit For
                    Next k
                    ActiveView = ViewMngr.GetView(ActiveViewNumber)
                    CaseSel = ActiveView.Selection.Get(IRobotObjectType.I_OT_CASE)
                    CaseSel.FromText("Simple Cases")
                    ViewMngr.Refresh()
                    Console.WriteLine("Selected Simple Cases" & vbCrLf)

 

Now it crashes on line 10 (line 198 in the full script) with the message:

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=RobotAPI
StackTrace:
at RobotAPI.Program.DumpTables() in C:\Users\Jelle.visser\source\repos\RobotAPI\RobotAPI\Program.vb:line 198

Labels (3)
8 REPLIES 8
Message 2 of 9

hi @Jelle.Visser 

the context is not the same

you confuse the selection of preliminary load cases to a parametric view with that relating to tabulated results

Best Regards

Message 3 of 9

Ah yes, I assumed I was doing something wrong. 
Can you point me in the right direction for selecting the active cases for tabulated results?
The documentation doesn't seem to have a clear solution, or at least I'm not seeing it. 

Message 4 of 9

@Jelle.Visser 

ok,

can you give me the full code?

The extract communicated concerns only the blocking point but it is not what you want.

Best Regards

Message 5 of 9

I can't paste the entire code here, that would be a bit long, but here is the repo:
https://github.com/Tebulo-Engineering/RobotAPI

The place where I tried to set the load case is line 189-201, and I print the reactions to csv on line 284 and onward

Message 6 of 9

hi @Jelle.Visser 

each RobotTable has a function Select that can accept for first IRobotSelectionType and for second parameter a string that could contain load cases
Ex : MyTable.Select I_ST_CASE, "1 2 3 ... "

Best regards

Message 7 of 9

Now when I add the following line after the if statement to check if it's the reactions table, it doesn't output any reaction csv anymore at all.

tf.Select(IRobotSelectionType.I_ST_CASE, "1 2 3 4 5 6 7 8")

Do note that I am programming in VB.NET, seeing your code, I assume that's vbs/vba?

The first 8 cases are the simple cases, so that's what I'd want to select, but as long as it works, it shouldn't be hard to change it.

Message 8 of 9

hi @Jelle.Visser 

tf refer to RobotTableFrame  

Select method is part of IRobotTable interface

t is RobotTable and come from tf RobotTableFrame by method Get

 

Imports RobotOM.IRobotSelectionType '< at beginning
[...]
Dim t As RobotTable
Dim tf As RobotTableFrame
t = tf.Get(j)
t.Select(I_ST_CASE, "1to8") ' equivalent to IRobotSelectionType.I_ST_CASE

 

note that you can select bars by same method

 

t.Select(I_ST_BAR, "1 2 3 ...")

 

Best Regards

Message 9 of 9

Thank you, that works!

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

Post to forums  

Autodesk Design & Make Report