API Help - Bar lenght and Other

API Help - Bar lenght and Other

RRufino
Advocate Advocate
2,115 Views
18 Replies
Message 1 of 19

API Help - Bar lenght and Other

RRufino
Advocate
Advocate

Hi all,

 

I was trying to adapt some macros that some users gently post here on Discussion Groups.

 

I already made a part of what i wanted...but this is the first time i'm trying to use macros, so i'm not being able to do the rest.

 

I have already a way to have all forces on my xls file, but i want to get in the following columns Lenght(m) | Section | Rect_BF | Rect_HT | Rect_EP | Bar Name | Deflection (mm)

 

How can i do this? Can you help me?

 

Thanks, please see attachement

0 Likes
Accepted solutions (1)
2,116 Views
18 Replies
Replies (18)
Message 2 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support

Example code:

The sectional data \ interface \ access depends of section type: from database or user or tappered or complex ....

What sections do you have?

 

Dim RobApp As New RobotApplication
Dim Bar As IRobotBar
Dim Sel As IRobotSelection
Dim Sec As RobotBarSection
Dim BarCol As RobotBarCollection
Dim sectData As IRobotBarSectionData



Set Sel = RobApp.Project.Structure.Selections.Get(I_OT_BAR)
Set BarCol = RobApp.Project.Structure.Bars.GetMany(Sel)

For i = 1 To BarCol.Count
    
    Set Bar = BarCol.Get(i)
    Set sectLab = Bar.GetLabel(I_LT_BAR_SECTION)
    Set sectData = sectLab.Data

    Set Sec = Bar.GetLabel(I_LT_BAR_SECTION)


    Cells((7 + i), 1) = Bar.Number
    Cells((7 + i), 2) = Bar.Length
    Cells((7 + i), 3) = Sec.Name
    Cells((7 + i), 4) = sectData.GetValue(I_BSDV_AX) ' A of section
    Cells((7 + i), 5) = sectData.GetValue(I_BSDV_D) ' h of section
 
Next i

Exit Sub

 

 



Rafal Gaweda
0 Likes
Message 3 of 19

RRufino
Advocate
Advocate

I have regular Rc Beams and Rc Columns.


I tried to copy that code to "my" macros but it simply not work...where should i paste that?


Thanks in advance

0 Likes
Message 4 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support

I have regular Rc Beams and Rc Columns.

 

OK , I will show you.


I tried to copy that code to "my" macros but it simply not work...where should i paste that?

 

It was example for steel sections - copy it to separate xls file



Rafal Gaweda
Message 5 of 19

RRufino
Advocate
Advocate

OK , I will show you.

 

Thanks Rafal, if you don't mind please check the attachement on my first post.

 

0 Likes
Message 6 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Take a look at attached xls



Rafal Gaweda
Message 7 of 19

RRufino
Advocate
Advocate

Dear Rafal, i don't know how to thank you!
Thank you so much!

Greetings from Portugal!

 

1000 kudos for you!

0 Likes
Message 8 of 19

Anonymous
Not applicable

Hi Rafal,

 

I'm seeing that this macro is for 2 or more points in a bar.

 

What should i do to extract data only for 1 point? 

 

For example:

 

I want data (forces, section propreties, etc...) for the point x=0 of the bar.

 

Thanks in advance,

 

Cheers!

0 Likes
Message 9 of 19

athurD
Advocate
Advocate

hi.

File excel erro ???????

2012-10-19_1736.png

0 Likes
Message 10 of 19

Anonymous
Not applicable

Where is the error?

0 Likes
Message 11 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support
 

What should i do to extract data only for 1 point? 

I want data (forces, section propreties, etc...) for the point x=0 of the bar.

 

Small modifications and we have a new macro ... attached

 



Rafal Gaweda
Message 12 of 19

Anonymous
Not applicable

Hi again,

 

Other question?

 

The current output is organized by nodes, i.e:

 

BarraCaso
15317
15417
15318
15418
15319
15419
15320
15420

 

What should i do to have this output:

 

BarraCaso
15317
15318
15319
15320
15417
15418
15419
15420

 

Thanks!

0 Likes
Message 13 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support

@Anonymous_GOOD wrote:

hi.

File excel erro ???????

 


Macros from this thread do not work with selections made  in robot.

Fill correct data in Excel cells or modify macro.



Rafal Gaweda
0 Likes
Message 14 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support
The current output is organized by nodes, i.e:

 

Barra Caso
1 53 17
1 54 17
     

 

What should i do to have this output:

 

Barra Caso
1 53 17
1 53 18
     
Just one loop should be changed ... file in message 19, below

 



Rafal Gaweda
Message 15 of 19

Anonymous
Not applicable

You are THE MAN! 🙂

 

Very Very Useful !

0 Likes
Message 16 of 19

RRufino
Advocate
Advocate

Hi Rafal, i tested this last file you sent to user FilRib and something is not ok....because that macro puts forces on end node equal to origin node.

0 Likes
Message 17 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi Rafal, i tested this last file you sent to user FilRib and something is not ok....because that macro puts forces on end node equal to origin node.


Yep, my mistake.

 



Rafal Gaweda
Message 18 of 19

RRufino
Advocate
Advocate

I think that the successive adaption turned the process too messy.

 

I tried this one and i found that for origin nodes some values are not ok (example: My and Mz), on the other hand if you have more then one combination, forces for end node still remains equal to origin node.

 

Or am i seeing this wrong?

0 Likes
Message 19 of 19

Rafal.Gaweda
Autodesk Support
Autodesk Support
 

Or am i seeing this wrong?


No, you are right. To many modifications.

Check this one.



Rafal Gaweda