VBA Excel macro for any object geometry modifications (API)

VBA Excel macro for any object geometry modifications (API)

Rafal.Gaweda
Autodesk Support Autodesk Support
28,718 Views
63 Replies
Message 1 of 64

VBA Excel macro for any object geometry modifications (API)

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

For those who might be interested I am attaching xls file with macro for objects geometry modifications.

One button to import geometry (characteriscic points coordinates) of selected objects (lines, polylines, arc, circles, panels), second - to update their geometry basing on data in Excell.

NOTE: modify only cells with coordinates.



Rafal Gaweda
Accepted solutions (1)
28,719 Views
63 Replies
Replies (63)
Message 21 of 64

Anonymous
Not applicable

Is it possible to export through this add-in the thickness as well?

0 Likes
Message 22 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Sure.

Attached.



Rafal Gaweda
0 Likes
Message 23 of 64

Anonymous
Not applicable

Thank Rafal!

But I didn't understand in which cell I can change the thickness!

Image 5.jpg

0 Likes
Message 24 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Column C if you are using objects_geometry_with_rounding_5.xlsm 

 

columnc.jpg



Rafal Gaweda
0 Likes
Message 25 of 64

Anonymous
Not applicable

OK, but what if...I want to have my own thickness and instead of creating it in a software I put it in an excel. Is it possible to load that thickness(defined in an excel sheet) to the software whether I always must create corresponding one in the software?

 

0 Likes
Message 26 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Sure it is.

You have to add \ write such code.



Rafal Gaweda
0 Likes
Message 27 of 64

Anonymous
Not applicable

Could do you it for me, please? I'm no able to write a code.

0 Likes
Message 28 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Have fun.

Attached



Rafal Gaweda
Message 29 of 64

Anonymous
Not applicable

Hi @Rafal.Gaweda is it possible to get dimensions from a bar? I 'm missing that code! 

Can you help me please?

Thank you so much!

0 Likes
Message 30 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous

 

My understanding is : Bar dimension = bar length

Bar length is calculated as distance between bar start node and endnode.

If you want to change bar length you have to move node(s).

See this addin.



Rafal Gaweda
0 Likes
Message 31 of 64

Anonymous
Not applicable

My bad @Rafal.Gaweda, for dimensions I mean B (base) and H (height) of the concrete section

0 Likes
Message 32 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

 

My bad @Rafal.Gaweda, for dimensions I mean B (base) and H (height) of the concrete section

 

 

Do you mean RC cross section dimensions?

Example here.



Rafal Gaweda
0 Likes
Message 33 of 64

Anonymous
Not applicable

@Rafal.Gaweda Importing into excel both dimensions B and H from a RC section in Robot

0 Likes
Message 34 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support
Hi @Anonymous

Importing into excel both dimensions B and H from a RC section in Robot


Look at the example I pointed you.

Instead of ...SetValue use ...GetValue



Rafal Gaweda
Message 35 of 64

Anonymous
Not applicable

What a long-standing forum! The add-in has clearly withstood the test of time...

 

Anyways, you can see in the screenshot that only 5 of hte nodes updated. This is because I added two intermediate points in the definition of hte panel, and I suspect the add-in doesn't support the addition of points -- it will only update the existing points.

 

Can you confirm I understand that correctly, or if there is in fact a way to add intermediate points to the definition of a panel with this add-in?

 

Thanks

Adding points in panel definition.png

0 Likes
Message 36 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous

 

 I suspect the add-in doesn't support the addition of points -- it will only update the existing points.

 

Exactly.

 



Rafal Gaweda
Message 37 of 64

Anonymous
Not applicable

Thanks Rafal. IF I was better at programming, I'd add that feature. I was easily able to copy the coordinates in the Excel table, into the Robot coordinates table for the definition of this panel -- so it wasn't hopeless.

 

 

0 Likes
Message 38 of 64

Anonymous
Not applicable

Hi @Rafal.Gaweda I did:

 

Set RLabel = RobApp.Project.Structure.Labels.Create(I_LT_BAR_SECTION, LabelName)
Set RBSD = RLabel.Data
    RBSD.ShapeType = I_BSST_CONCR_BEAM
    Set RBSCRD = RBSD.Concrete
    RBSCRD.GetValue I_BSCDV_BEAM_B, (Cells(Row, 10).Value)

but i get the following error:

"Wrong number of arguments or invalid property assignment"

0 Likes
Message 39 of 64

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous

 

My understanding is you want to GET it so example below:

 

Dim RLabel As RobotLabel
Dim RBSD As RobotBarSectionData
Dim RBSCRD As RobotBarSectionConcreteData

Set RLabel = RobApp.Project.Structure.Labels.Get(I_LT_BAR_SECTION, "B 30x50")
Set RBSD = RLabel.Data
Set RBSCRD = RBSD.Concrete
Cells(1, 10) = RBSCRD.GetValue(I_BSCDV_BEAM_B)


Rafal Gaweda
0 Likes
Message 40 of 64

Anonymous
Not applicable

My bad @Rafal.Gaweda, what I mean is to get for a generic beam both base and height dimensions from robot into excel.

In your example I think is for a specific beam "B 30x50"

0 Likes