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 - I_LRT_IN_CONTOUR not working

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
infoPDHYH
339 Views, 5 Replies

API - I_LRT_IN_CONTOUR not working

Hello.

 

I am currently facing a challenge in making a script function as intended. This script, which I have successfully employed in the past in a similar fashion, is now encountering issues that thwart its proper execution.

 

The scenario involves a collection of panels arranged to create circular structures, specifically sheet piling caissons. These structures are subject to a uniform load directed along a specific vector but only applied up to a certain height. This emulates current-induced forces.

 

Despite having employed a similar methodology successfully before, the present scenario yields a warning message, indicating incorrect definition of the contour load, thus not introducing the load and, consequently, not yielding results.

 

Here is the code and the message.

 

For i = 20 To 80 'Number of the loaded panels

Set obj = obj_server.Get(i)
Set geo_obj = obj.Main.GetGeometry()
Set contour = geo_obj
Set segment1 = contour.Segments.Get(1)
Set segment2 = contour.Segments.Get(2)
                
Xio = segment1.P1.x
Yio = segment1.P1.Y
Zio = segment1.P1.Z
Xfo = segment2.P1.x
Yfo = segment2.P1.Y
Zfo = segment2.P1.Z
Xm = (Xio + Xfo) / 2
Ym = (Yio + Yfo) / 2
                
angulo_panel = WorksheetFunction.Atan2(Xm, Ym)
                
'Clause to determine whether the panel has to be loaded or not
                
dist_panel = Sqr(Xm ^ 2 + Ym ^ 2)
                
'Limit anglees
                
alim_inf = ang_corriente - Pi / 2
alim_sup = ang_corriente + Pi / 2
                
'Panel local z axis direction determination for load direction
                
Set obj = obj_server.Get(i)
obj.Main.Attribs.GetLCS Xp, Yp, Zp
angulo_Z_panel = WorksheetFunction.Atan2(Zp.x, Zp.Y)

'Conditional to check if the panel is within the distance and the angles, and that the local z axis angle with current angle is less than 90 degress.
                
If dist_panel >= dist_lim_1 And dist_panel <= dist_lim_2 And angulo_panel >= alim_inf And angulo_panel <= alim_sup And Abs(angulo_Z_panel - ang_corriente) < Pi / 2 Then  

cas.Records.New I_LRT_IN_CONTOUR
Set rec = cas.Records.Get(cargados + 1)
                    
rec.SetValue I_ICRV_PX1, -pcor * 10000 * Cos(ang_corriente)
rec.SetValue I_ICRV_PY1, -pcor * 10000 * Sin(ang_corriente)
rec.SetValue I_ICRV_PZ1, 0#

rec.SetValue I_ICRV_PROJECTION, 0
rec.SetVector 0, 0, 1
rec.SetValue I_ICRV_NPOINTS, 4
rec.SetValue I_ICRV_LOCAL, 0
rec.SetValue I_ICRV_AUTO_DETECT_OBJECTS, 0
                        
'Contour points
                        
rec.SetContourPoint 1, Xio, Yio, Zio
rec.SetContourPoint 2, Xfo, Yfo, Zfo
rec.SetContourPoint 3, Xfo, Yfo, Zfo + calado
rec.SetContourPoint 4, Xio, Yio, Zio + calado
                        
'The load is added to the panel
rec.Objects.AddOne (i)
                        
cargados = cargados + 1
End If

Next i

 

Message.png

 

Could anyone give me a hint?

 

Thanks.

 

5 REPLIES 5
Message 2 of 6

hi @infoPDHYH 

could you show the definition of all variable types, including those defined outside the scope of the for next loop (ang_corriente, dist_lim_1, dist_lim_2, cargados, pcor, calado), provide the result (make an extract from the table) including showing the coordinates and values of the charges obtained.

For the new load, you could use the create method instead of new and the "cargados" index.

Could you share your project file?

Best Regards

Message 3 of 6

Hi @Stephane.kapetanovic , thanks for the answer.

 

Let me give you the requested details:

 

ang_corriente: angle of the current, taken as input from the sheet and converted to radians at the beginning of the code. 

dist_lim1, dist_lim2: these are two auxiliary variables that defines two radiuses. Since the cofferdam has internal divisions, not affected by the current, only the external panels must be loaded. To do this, and taking advantage of the fact that the external panela lie between two circles, these radiuses are calculated and the distance of the panel to the center is compared with them. In other words, this leaves unloaded some panels.

cargados: it is a temporary variable that counts the number of panels loaded in the load case. This is required to select the relevant load record in each loop since the number of panels is unknown at the beginning of the process.

pcor: This is the value of the current equivalent pressure in kN/m2. It is taken from an input cell in the spreadsheet

calado: Basically this is the distance from the bottom of the panel to the upper limit of the load. If calado was defined equal to the height of the cofferdam the load would be a uniformly distributed load applied to the entire panel.

 

I am attaching the model file with the faulty load for you to explore if desired.

 

Best regards.

 

 

Message 4 of 6

hi @infoPDHYH 

and the definitions look like these ?

Dim Objects As RobotObjObjectServer
Dim Obj As RobotObjObject, GeoObj As RobotGeoObject, Contour As RobotGeoContour
Dim Sgmt1 As IRobotGeoSegment, Sgmt2 As IRobotGeoSegment
Dim Cas As RobotSimpleCase, Rec As RobotLoadRecordInContour
Dim Xp As RobotGeoPoint3D, Yp As RobotGeoPoint3D, Zp As RobotGeoPoint3D

Dim Pi2 As Double = PI / 2
Dim Xio, Yio, Zio, Xfo, Yfo, Zfo, Xm, Ym, angulo_panel, angulo_Z_panel, dist_panel, alim_inf, alim_sup
Dim ang_corriente, dist_lim_1, dist_lim_2, cargados, pcor, calado

With RobApp
    With .CmpntFactory
        Xp = .Create(I_CT_GEO_POINT_3D)
        Yp = .Create(I_CT_GEO_POINT_3D)
        Zp = .Create(I_CT_GEO_POINT_3D)
    End With
    With .Project.Structure
        Objects = .Objects
        Cas = .Cases.Get(1)
    End With
End With

 

 

dummy settings but it works! Great !

Stephanekapetanovic_0-1697441572311.png

The message is only a warning. The Create and New methods give the same message, there is no CreateLike function to ensure the origin of the warning.
your points are exactly those on the panel, the charge is not wrong.
All that remains is to check the loads applied with regard to the reactions to ensure that all the loads are correctly applied.

 

Best Regards

Tags (4)
Message 5 of 6

Thank you for the suggestions. Unfortunately they did not work for me. However, after some trial and error I have come across what the issue was. 

It has to do with the projection of the contour. 

When defining the code this way it does not work

rec.SetValue I_ICRV_PROJECTION, 0
rec.SetVector 0, 0, 1

I have resolved the issue by using the existing variables

Xp, Yp, Zp

To project the contour perpendicular to each panel. By doing this it works nicely and the routine defines an equivalent current load within the desired limits. Maybe @Rafal.Gaweda or other Autodesk member can give us a quick explanation on how this commands work within the API.

 

In my previous code developed years ago I already worked this out somehow, but my memory failed me and when trying to reduce the code I introduced this issue. 

 

Thanks @Stephane.kapetanovic for your nice help. I have learned a couple of things following your guidance.

 

Best Regards.

Message 6 of 6

hi @infoPDHYH 

the initial post discussed a script you had previously, but now it seems you're considering a change in your approach to load your panels perpendicularly by adjusting the axis direction in your script.

It's worth noting that for inquiries related to the inner workings of the API, it is advisable to seek an official response from the support team. If you found an answer helpful, please consider upvoting it.

Best Regards

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report