Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(API) macro for updating panel contour loads from Excel

26 REPLIES 26
SOLVED
Reply
Message 1 of 27
Rafal.Gaweda
4509 Views, 26 Replies

(API) macro for updating panel contour loads from Excel

First import contour loads (automatically for all simple cases)

Then you can change values in Px1..Pz3 columns, and X Y Z columns and run Update

 

Do not make any change in Case, Record, Object List or Number of contour points columns (or modify macro by your own to consider these or other changes you want)

 

 



Rafal Gaweda
26 REPLIES 26
Message 2 of 27
Rafacascudo
in reply to: Rafal.Gaweda

Rafal ,

 

great tool !

It would be nice if the units used in the model could be kept when you press " Get contour loads".

I´m using tf/m2 and the loads are imported in N/m2

Rafael Medeiros
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 3 of 27
Rafal.Gaweda
in reply to: Rafacascudo

Who volunteers to do so?

 

 

Example code for geting units (for force and moment) from Robot:

 

Dim projPref As RobotProjectPreferences
Set projPref = Robot.Project.Preferences

Dim RU As RobotUnitData
Set RU = projPref.Units.Get(I_UT_FORCE)


Dim RUCD As RobotUnitComplexData
Set RUCD = projPref.Units.Get(I_UT_MOMENT)

 

 



Rafal Gaweda
Message 4 of 27
Rafal.Gaweda
in reply to: Rafal.Gaweda

Keeping model units - attached.



Rafal Gaweda
Message 5 of 27
kam.ha93
in reply to: Rafal.Gaweda

when you input a load manually in excel and then update it gives you a runtime error.
i have a building whose contour loads are the same for several typical stories and till now there's no practical method of aplying these loads wihtout it being tedious.

i tried inputing the loads manually in excel and then clicking "update loads" but it just wouldn't work.

any help would be much appreciated.

Message 6 of 27
Rafal.Gaweda
in reply to: kam.ha93

Check \ set \ register Robot this way:

 

http://forums.autodesk.com/t5/robot-structural-analysis/vba-excel-macro-for-any-object-geometry-modi...

 

 

 

 



Rafal Gaweda
Message 7 of 27

Good morning,

 

very "smart" and speedy API.

 

Thanks

 

 


PasProStudio

www.pasquiniprogetti.eu

Structural + Detailing engineers
Message 8 of 27
annp_mth
in reply to: Rafal.Gaweda

I've tried this way but this add-in could not run. When I chose contour and pressed " Get contour loads", nothing happened!!! (My model have a contour with area load).

Another add-in by VBA run normally.

Message 9 of 27
Rafal.Gaweda
in reply to: annp_mth

It should be like that

 

cu.jpg

 

 



Rafal Gaweda
Message 10 of 27
Romanich
in reply to: Rafal.Gaweda

Hi @Rafal.Gaweda,

 

Could you please confirm that the method which operates with the marked checkbox is not implemented in the API?

Auto.png

Or maybe I'm wrong (fingers crossed)?

 

 

Updated:

 

Robot is really cool - I_ICRV_AUTO_DETECT_OBJECTS

 

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


Message 11 of 27
Romanich
in reply to: Romanich

Updated macro attached. One column has been added (0 - checkbox is off, 1 - checkbox is on).

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


Message 12 of 27

Hello

I would like to create a load in C #.
I do not understand how to create the contour of this one?

I'm deadlocked ...

 

Thanks

 

JM Stevenant

 

 

My code:

image.png

Message 13 of 27

Hi @jean-mariestevenant

 

Just edit my macro to see what is missing.

 

LoadRecord.SetContourPoint .........


Rafal Gaweda
Message 14 of 27

Thank you for your prompt reply.

However, I have already tried and it's bug:
Severity Code Description Project File Line Deletion Status
Error CS1061 'RobotLoadRecord' does not contain a definition for 'SetContourPoint' and
no 'SetContourPoint' extension method that accepts a first argument of type 'RobotLoadRecord'
was found (using directive or assembly reference) missing?)

 

 

Thank you for your help.

image.pngimage.png

Message 15 of 27

Hi @jean-mariestevenant

 

My guess it that your LoadRecord is of not correct type.

 

You need something like this:

 

RobotLoadRecordInContour LoadRecord= (RobotLoadRecordInContour)case.Records.Get(UniformInCountour);


Rafal Gaweda
Message 16 of 27

Yes perfect that's work now,

Thanks you!

Message 17 of 27

Hi,

I just started using ROBOT programming tools. 

can you please help me finding what is missing in my VBA code? I'm getting a warning after launching calculus "incorrect definition of contour load ...." 

Beside, changing I_ICRV_PZ2 and I_ICRV_PZ3 has no effect on my load

PS : All variables are declared

 

iLC = iLC + 1
Dim LGR As RobotSimpleCase
Set LGR = pipo.Cases.CreateSimple(iLC, "Longrine", I_CN_PERMANENT, I_CAT_STATIC_LINEAR)


chargeAppli = LGR.Records.New(I_LRT_IN_CONTOUR)
Set LoadRecCont = LGR.Records.Get(chargeAppli)
'Define the list of objects to which load will be applied.
LoadRecCont.Objects.FromText "3"


donnee1 = Val(ActiveSheet.Range("D15"))
donnee2 = Val(ActiveSheet.Range("E15"))
donnee3 = Val(ActiveSheet.Range("F15"))
donnee4 = Val(ActiveSheet.Range("G15"))

LoadRecCont.SetValue I_ICRV_PX1, 0
LoadRecCont.SetValue I_ICRV_PY1, 0
LoadRecCont.SetValue I_ICRV_PZ1, -donnee1 * donnee2 * 1000

LoadRecCont.SetValue I_ICRV_AUTO_DETECT_OBJECTS, 0
LoadRecCont.SetValue I_ICRV_NPOINTS, 4

LoadRecCont.SetContourPoint 1, 0, donnee3, haut
LoadRecCont.SetContourPoint 2, ouv, pas_biais + donnee3, haut
LoadRecCont.SetContourPoint 3, ouv, pas_biais + donnee3 + donnee4, haut
LoadRecCont.SetContourPoint 4, 0, donnee3 + donnee4, haut


LoadRecCont.SetValue I_ICRV_PY2, 0
LoadRecCont.SetValue I_ICRV_PZ2, -1000
LoadRecCont.SetValue I_ICRV_PX3, 0
LoadRecCont.SetValue I_ICRV_PY3, 0
LoadRecCont.SetValue I_ICRV_PZ3, -8000

 

Message 18 of 27

Hi @ClémentTAHERI6316 

 

You missed SetPoint.

Example code below:

 

Private Sub CommandButton1_Click()
Dim robapp As New RobotApplication
Dim LGR As RobotSimpleCase
Set LGR = robapp.Project.Structure.Cases.Get(1)

chargeAppli = LGR.Records.New(I_LRT_IN_CONTOUR)
Set LoadRecCont = LGR.Records.Get(chargeAppli)
'Define the list of objects to which load will be applied.
LoadRecCont.Objects.FromText "3"

donnee1 = 3
donnee2 = 3
donnee3 = 3
donnee4 = 3

LoadRecCont.SetValue I_ICRV_AUTO_DETECT_OBJECTS, 0
LoadRecCont.SetValue I_ICRV_NPOINTS, 4

LoadRecCont.SetContourPoint 1, 0, donnee3, 0
LoadRecCont.SetContourPoint 2, 3, 1 + donnee3, 0
LoadRecCont.SetContourPoint 3, 3, 1 + donnee3 + donnee4, 0
LoadRecCont.SetContourPoint 4, 0, donnee3 + donnee4, 0

LoadRecCont.SetValue I_ICRV_PX1, 0
LoadRecCont.SetValue I_ICRV_PY1, 0
LoadRecCont.SetValue I_ICRV_PZ1, -donnee1 * donnee2 * 1000
LoadRecCont.SetValue I_ICRV_PY2, 0
LoadRecCont.SetValue I_ICRV_PZ2, -1000
LoadRecCont.SetValue I_ICRV_PX3, 0
LoadRecCont.SetValue I_ICRV_PY3, 0
LoadRecCont.SetValue I_ICRV_PZ3, -8000

LoadRecCont.SetPoint 1, 0, donnee3, 0
LoadRecCont.SetPoint 2, 3, 1 + donnee3, 0
LoadRecCont.SetPoint 3, 3, 1 + donnee3 + donnee4, 0

End Sub


Rafal Gaweda
Message 19 of 27

thank you.

the first problem is remains. After lunching the calculus I've got the warning bellow :

"Incorrect definition of contour load for the load case 2" : the load case 2 is actually the one I'm setting

ClémentTAHERI6316_0-1586261316039.png

 

Message 20 of 27

Hi @ClémentTAHERI6316 

 

Check geometry \ coordinates.

 



Rafal Gaweda

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report