API - Pseudostatic acceleration (VBA code or Table)

API - Pseudostatic acceleration (VBA code or Table)

Anonymous
Not applicable
674 Views
3 Replies
Message 1 of 4

API - Pseudostatic acceleration (VBA code or Table)

Anonymous
Not applicable

Hello,

 

I want to retrieve the components of acceleration from the pseudostatic forces of spectral cases for many nodes with API.

 

I know we can collect forces with this code :

- RobApp.Project.Structure.Results.Nodes.PseudostaticForces.CombValue(Nodenumber,CaseNumber,I_MCT_CQC).FX

- RobApp.Project.Structure.Results.Nodes.PseudostaticForces.value(NodeNumber,CaseNumber,ModeNumber).FX

 

On the other hand, how can we extract the acceleration components ?

 

 

If this is not possible, we can open the table " pseudostatic Force" - add the columns that correspond to the acceleration components.  How can I add the good column ?

 

thanks

0 Likes
Accepted solutions (1)
675 Views
3 Replies
Replies (3)
Message 2 of 4

marcinrakus
Autodesk
Autodesk
Accepted solution

Try use Any from ResultsServer

 

RobotOM.RobotApplication r = new RobotOM.RobotApplication();

r.Project.Structure.Results.Any.ResultId = 1328; //up to 1333
r.Project.Structure.Results.Any.Node = 1;
r.Project.Structure.Results.Any.LoadCase = 3;
r.Project.Structure.Results.Any.Mode = 1;

            MessageBox.Show(r.Project.Structure.Results.Any.ResultValue.ToString());

 

There is a simple trick to obtain results type Id : open any table, display desired columns and run this macro - in most cases this number is the same:

 

RobotOM.RobotApplication r = new RobotOM.RobotApplication();
RobotOM.RobotTableFrame tf = r.Project.ViewMngr.GetTable(1);
RobotOM.RobotTable t = tf.Get(1);

for (int i = 1; i <= t.ColCount; i++)
{
    MessageBox.Show(t.GetDataType(i).ToString());
}

 

 

Message 3 of 4

Anonymous
Not applicable

Thanks.

 

You reply before i get the solution. I tried this code to get the column number :

Sub InfoTable()

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication
Dim t As RobotTable
Dim tf As RobotTableFrame
Dim i, j As Long



nTables = RobApp.Project.ViewMngr.TableCount
If nTables = 0 Then
    MsgBox "No table opened"
    Exit Sub
End If

For i = 1 To nTables
        Set tf = RobApp.Project.ViewMngr.Gettable(i)
        For j = 1 To tf.Get(i).ColCount
                Debug.Print tf.Get(i).GetDataType(j)
        Next j
Next i
        
        set t = RobApp.Project.ViewMngr.CreateTable(I_TT_PSEUDOSTATIC, I_TDT_VALUES)
        t.AddColumn (1328)
        t.AddColumn (1329)
        t.AddColumn (1330)
        t.AddColumn (1328)
        t.AddColumn (1329)
        t.AddColumn (1330)
End Sub

Other question : how can i remove column ????

 

0 Likes
Message 4 of 4

marcinrakus
Autodesk
Autodesk
Unfortunatelly there is no function to remove columns.
0 Likes