API or macro to send bar forces to excel in certain order

me1205377
Advocate

API or macro to send bar forces to excel in certain order

me1205377
Advocate
Advocate

Greetings, if you could please write a small code to send bar forces to excel in this way i will be very grateful. it takes forever to manually read and type bar forces in excel in the following manner 

side note i am not sure if it is too much to ask as i dont know how hard/easy it is to create this macro or addin . i will be happy to pay for this if it takes time. 

API goal.PNG

 

moustafa elgaar
0 Likes
Reply
Accepted solutions (2)
2,508 Views
18 Replies
Replies (18)

me1205377
Advocate
Advocate

I am using RSA2015  if it makes any difference 

moustafa elgaar
0 Likes

Romanich
Mentor
Mentor

Hi Moustafa,

 

Have you seen this thread?

https://forums.autodesk.com/t5/Autodesk-Robot-Structural/getting-internal-forces-from-RSA-to-XL-API/...

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


me1205377
Advocate
Advocate

yes Mr. Romanich  i have checked it and it contain similar spread sheets to what i need, but not quite the same  the order  must e exactly as in the attached picture. this is because i have to send theses results to another program who can only read RC column forces in this order:

for each column , the program need ( Fx , MYt , MYb, MZb, MZb ) in a text file.

i hope you can help me 

moustafa elgaar
0 Likes

me1205377
Advocate
Advocate

 (Fx , MYt , MYb, MZy, MZb )  

 

 

this is the big picture 

i start with robot , i get these forces in this particular  order into excel, then i change these cells to text format using "concatenate" function then  copy and paste in a text file and finally export to a program such as SP Column 

importing.JPG

moustafa elgaar
0 Likes

marcinrakus
Autodesk
Autodesk

Hi,

 

This is something You can start working with (see attachment). It is quite inefficient and I'm not sure about coordinate system in which the other application requires the data. This dumps all in local coordinate system of bar as is in RSA.

 

We can iterate this solution if needed.

 

Regards,

Marcin

me1205377
Advocate
Advocate

thank you very much for your help  it looks very promising 

just few adjustment if it is not too much to ask  🙂 

 

what ever  selection of bars i make in robot  say 5 bars , regardless of the  bar numbers being selected say ( 224,158,987,1526,3) . only bars with the numbering from 1 to 5 are sent to excel instead.

 

case number are also ignored , regardless of what set of cases i select from robot  only simple cases are sent not combinations  

 

finally, the units, it would be great if forces are in (KN)  and Moment in (KN.M)

 

moustafa elgaar
0 Likes

marcinrakus
Autodesk
Autodesk
Accepted solution

Hi,

 

Selection of bars - corrected.

Units changed to kN - corrected.

Selection of cases - this works different by API, so I added a field in excel (the green one), where You can enter Your selection. If it is empty by default full selection of simple cases, combinations and ponderations is taken into consideration.

 

Regards,

Marcin

me1205377
Advocate
Advocate

i accept it as a solution , just if you have some spare time, could you limit the decimal places to 3 numbers only  eg: "  2420.321 KN"  instead of "2420.32014568 KN" 

moustafa elgaar
0 Likes

marcinrakus
Autodesk
Autodesk
Accepted solution

Rounded.

 

Regards,

Marcin

me1205377
Advocate
Advocate

thank you sir ,wish you some good karma 

moustafa elgaar
0 Likes

isabel.bras
Contributor
Contributor

It is possible to have the forces in a point in the middle of the bar?

0 Likes

marcinrakus
Autodesk
Autodesk

Hello,

 

In the macro You can see for example lines:

val1 = RobApp.Project.Structure.Results.bars.Forces.Value(bar.Number, casNumber, 0).FX / 1000
val2 = RobApp.Project.Structure.Results.bars.Forces.Value(bar.Number, casNumber, 1).FX / 1000

in which 0 means begin and 1 means end of a member. If You put 0.5 You will obtain results for middle point:

val3 = RobApp.Project.Structure.Results.bars.Forces.Value(bar.Number, casNumber, 0.5).FX / 1000

 

Regards,

Marcin

0 Likes

isabel.bras
Contributor
Contributor

When I try do run the macro, it appears an errorerro.png.

When I go to Debug it appears: erro2.png

 

Do you know what is happening?

0 Likes

Stephane.kapetanovic
Mentor
Mentor

This code works ! Are you sure Robot and a model is open ? 

Have you check references to Robot Object Model in visual basic editor (<tools> <references>) ?  

isabel.bras
Contributor
Contributor

Hello

 

Can you explain how can I check the references?

 

Thanks

0 Likes

Stephane.kapetanovic
Mentor
Mentor

In your spreadsheet, press Alt+F11 to go to visual basic editor

Go to <Tools> and <Références> and then find Robot Object Model ver. xxx

image.pngimage.png

 

isabel.bras
Contributor
Contributor

yes, I'm using the correct version...

0 Likes

isabel.bras
Contributor
Contributor

I reinstall Robot and solved the problem.

 

Thanks

0 Likes