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
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
Solved! Go to Solution.
Solved by Stephane.kapetanovic. Go to Solution.
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
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.
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
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
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
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.
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
Can't find what you're looking for? Ask the community or share your knowledge.