Hi,
During the last months of year 2011 I had a few discussions with Marcin Rakus and Marek Wiecek about how to manage with the load on claddings through the Robot Open Source API.
The conclusion was that the API of RSA 2011 did not cover 100% of program functionality, making it impossible to manipulate such data. Typically, when accessing the load type I_LRT_UNIFORM associated to claddings in my RSA models, I get not only the loads on the cladding itself but also the ones generated automatically on the bars being in the influence area of the cladding. The API seemed to work fine with panels, unfortunately I do not use such objects. We also tried to write some code to convert claddings into panels, and the opposite, but it did not lead to something satisfying.
Has the API of RSA 2012 been updated to allow an efficient management of claddings ?...
Solved! Go to Solution.
I have not checked yet in code but according to documentation this flag is available from v.2012
If IsAutoGenerated = true (1) such records can be skipped during ....
Hi,
Ok I'll try to check in code, but how do you get access to this parameter ?
For example, working with a RobApp object initialized with Set RobApp = New RobotApplication : RobApp.Project.Structure... ???
Thanks
Sample Excel VBA code:
records with TRUE below displayed = generated automaticaly from cladding
Sub Button1_Click() Dim RobApp As IRobotApplication Set RobApp = New RobotApplication Dim iscsel As IRobotSelection Dim RLCom As IRobotLoadRecordCommon Set iscsel = RobApp.Project.Structure.Selections.CreatePredefined(I_PS_CASE_SIMPLE_CASES) Dim col As IRobotCaseCollection Set col = RobApp.Project.Structure.Cases.GetMany(iscsel) Dim isc As IRobotSimpleCase Row = 10 For c = 1 To col.Count Range("B9").Value = Format(c) & " / " & Format(ccount) Dim icase As IRobotCase Set icase = col.Get(c) If icase.Type = I_CT_SIMPLE Then Set isc = icase Dim r As Long, i As Long, rcount As Long rcount = isc.Records.Count r = 1 While r > 0 And r <= isc.Records.Count Rr = "B" + Trim(Str(Row)) Range(Rr).Value = icase.Number & " / " & Format(isc.Records.Count) DoEvents Dim irec As IRobotLoadRecord Set irec = isc.Records.Get(r) Set RLCom = isc.Records.Get(r) Cells(Row, 3) = Str(RLCom.IsAutoGenerated) Cells(Row, 4) = irec.Objects.ToText Set irec = isc.Records.Get(r) For iic = 0 To 14 Cells(Row, 5 + iic) = irec.GetValue(iic) Next iic Row = Row + 1 r = r + 1 Wend Set isc = Nothing End If Set icase = Nothing Next c Set col = Nothing Set iscsel = Nothing RobApp.Interactive = 1 Set RobApp = Nothing End Sub
OK, this flag is doing well.
It solves the question of accessing to a uniform load on a cladding.
Now a last one : I wanted to extend this to a load defined by three points (IRobotLoadRecordIn3Points). The flag is efficient as well but I have some trouble with the VBA code to get the coordinates of the points. The documentation suggests to use this method :
Public Function GetPoint(_which_point As int, ByRef _x As double*, ByRef _y As double*, ByRef _z As double*) As Boolean
First remark : when writing the code in the VBA Excel interface the type of the function is told to be a "long". It's not necessary a problem because the result of the function is no matter of interest."Get coordinates of given point of load. Return false when given point has not "In fact if false it returns 0, if true -1. They can be long or bool.Do you have some example of a code properly writed in VBA ?...
Sub AAAA() Dim RobApp As IRobotApplication Set RobApp = New RobotApplication Dim iscsel As IRobotSelection Dim RLCom As IRobotLoadRecordCommon Set iscsel = RobApp.Project.Structure.Selections.CreatePredefined(I_PS_CASE_SIMPLE_CASES) Dim col As IRobotCaseCollection Set col = RobApp.Project.Structure.Cases.GetMany(iscsel) Dim isc As IRobotSimpleCase Row = 10 For c = 1 To col.Count Set isc = col.Get(c) Dim r As Long, i As Long, rcount As Long rcount = isc.Records.Count For r = 1 To rcount Dim irec As IRobotLoadRecord Set irec = isc.Records.Get(r) If (irec.Type = I_LRT_IN_3_POINTS) Then Dim Cr As RobotLoadRecordIn3Points Set Cr = isc.Records.Get(r) Dim X As Double Dim Y As Double Dim Z As Double For i = 1 To 3 Cr.GetPoint i, X, Y, Z Cells(Row, 3) = "Point " & Str(i) Cells(Row, 4) = X Cells(Row, 5) = Y Cells(Row, 6) = Z Cells(Row, 7) = "Value" Cells(Row, 8) = Cr.GetValue(i * 3 - 3) Cells(Row, 9) = Cr.GetValue(i * 3 - 2) Cells(Row, 10) = Cr.GetValue(i * 3 - 1) Row = Row + 1 Next i End If Row = Row + 1 Next r Set isc = Nothing Set icase = Nothing Next c Set col = Nothing Set iscsel = Nothing RobApp.Interactive = 1 Set RobApp = Nothing End Sub
Thanks for the example
After looking for a long time for errors in the objects syntax (unsuccessfully), I found out quite by chance why the compilation failed :
when declaring variables I often use such a syntax to save time :
Dim X, Y, Z as Double
in Excel VBA this should not be different from :
Dim X as Double
Dim Y as Double
Dim Z as Double
but here the code does not run when using the first method... don't understand why
Anyway, this answers the whole question.
We also tried to write some code to convert claddings into panels, and the opposite, but it did not lead to something satisfying.
Dim r As New RobotOM.RobotApplication Dim o As RobotOM.RobotObjObject o = r.Project.Structure.Objects.Get(1) o.SetLabel(RobotOM.IRobotLabelType.I_LT_CLADDING, "Two-way") o.Update()Most important o.Update() at the end
Can't find what you're looking for? Ask the community or share your knowledge.