Get forces from Robot to Excel with C#

Get forces from Robot to Excel with C#

Anonymous
Not applicable
981 Views
7 Replies
Message 1 of 8

Get forces from Robot to Excel with C#

Anonymous
Not applicable

Hello everyone,
Can I get forces from Robot and write down to Excel by C# ?
I would not want to do it with VBA.

I would appreciate all tips in C#

0 Likes
982 Views
7 Replies
Replies (7)
Message 2 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

Yes, you can.

 



Rafal Gaweda
0 Likes
Message 3 of 8

Anonymous
Not applicable

Could You give me some help how to do it ? It's my first program in Robot.
I would like to get all Fx forces in bars. How can I find all bars on the model ? How can I get values of forces and forces coordinates ? 
Thank You for Your help 🙂

0 Likes
Message 4 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

I would suggest starting from here:

https://forums.autodesk.com/t5/robot-structural-analysis-forum/useful-addins-for-robot-api/td-p/3899448



Rafal Gaweda
Message 5 of 8

Anonymous
Not applicable

I managed to get forces and load cases from Robot but I have some problem with nodes.
I would like to get StartNode and EndNode of every bar but I obtain some different nodes that I don't want to get.
My code:
 

 

RobotSelection SelectionBars = robApp.Project.Structure.Selections.CreateFull(IRobotObjectType.I_OT_BAR);
IRobotCollection CollectionBars = (IRobotCollection)robApp.Project.Structure.Bars.GetMany(SelectionBars);

 

IRobotCollection NodeCol = (IRobotCollection)robApp.Project.Structure.Nodes.GetMany(SelectionBars);
RobotNode rNode;
for (int i = 1; i < NodeCol.Count; i++)
{
rNode = NodeCol.Get(i);
Console.WriteLine("rNode X: " + rNode.X);
Console.WriteLine("rNode Y: " + rNode.Y);
Console.WriteLine("rNode Z: " + rNode.Z);


}

I've tried to get StartNode and EndNode for every bar but I can't find a way how to do it.

0 Likes
Message 6 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

Node Collection should be created from Node Selection , not Bar Selection.

 



Rafal Gaweda
Message 7 of 8

Anonymous
Not applicable

Thank You Rafal but I still haven't solved my problem. I would like to get nodes only for Objects of a model "Bars" but this way I get nodes for Objects of a model "Nodes". Not all nodes from "Nodes" are bars nodes.

Przechwytywanie.PNG

Is there a way to get StartNode and EndNode only for bars?

0 Likes
Message 8 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

You have to get them from bars loop.

Nothing automatic.

 



Rafal Gaweda
0 Likes