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: 

Moving load case components to static cases - API

11 REPLIES 11
Reply
Message 1 of 12
nrdev
660 Views, 11 Replies

Moving load case components to static cases - API

Hi,

 

I'm facing the problem of solving non-linear combinations with moving loads :

I can perfectly solve the moving load case in non-linear analysis but I dont have any results if I combine it with other static load cases.

 

Although I've read on a forum topic here that it's not a feature, It seems strange that solving non-linear moving load cases is possible but combinations of it with static cases isn't.

 

Considering it's not possible, I'm trying to export components of a moving case to static ones but the embeded function in RSA is messy as it takes every empty case number ...

Hence, iI'm trying to write an VBA macro that does the job and starts at the specified case number.

 

Problem is I can't get to copy load records to the static case.

 

First attempt of code's here :

Public Sub movToStaticCases(movingCaseId As Integer, firstStatic As Integer)
    Dim RobApp As IRobotApplication
    Set RobApp = New RobotApplication
    Dim RCS As IRobotCaseServer, robCase As IRobotCase, movCase As RobotMobileCase
    
    
    Set RCS = RobApp.Project.Structure.Cases
    Set robCase = RCS.Get(movingCaseId)
    If Not robCase.Type = I_CT_MOBILE Then
        MsgBox "Case " & movingCaseId & " is not a mobileload case"
        Exit Sub
    Else
        Set movCase = robCase
        Dim iComp As Integer, compRecs As RobotLoadRecordMngr, compRec As IRobotLoadRecord, iRec As Integer
        Dim newCase As RobotSimpleCase, newRec As RobotLoadRecord, oldRec As RobotLoadRecord
        
        If movCase.Components.Count = 0 Then
            MsgBox "Moving load case contains no components, please make sure to run the computation to generate components"
            Exit Sub
        End If
        
        For iComp = 1 To movCase.Components.Count
            'Create the new static case
            If RCS.Exist(firstStatic + iComp - 1) Then RCS.Delete firstStatic + iComp - 1
            
            Set newCase = RCS.CreateSimple(firstStatic + iComp - 1, movingCaseId & "/" & iComp, I_CN_EXPLOATATION, movCase.AnalizeType)
            
            Set compRecs = movCase.Components.Get(iComp).Records
            For iRec = 1 To compRecs.Count
                Set oldRec = compRecs.Get(iRec)
                Set newRec = newCase.Records.Create(oldRec.Type)
    
                'Next : do i need to copy every parameter one by one or is there a simpler way
            Next iRec
        Next iComp
    End If
End Sub

 

Thanks.

Regards

11 REPLIES 11
Message 2 of 12
Rafal.Gaweda
in reply to: nrdev

check with this:

 

Dim RLCom As RobotLoadRecordCommon

Dim rec As RobotLoadRecord

....
Set rec = isc.Records.Get(irec)
Set RLCom = isc.Records.Get(irec)

if RLCom.IsAutoGenerated then.....



Rafal Gaweda
Message 3 of 12
nrdev
in reply to: Rafal.Gaweda

Thanks for your quick answer, but would you care to elaborate a little more ?

 

I'm using RSA 2012 and I can't find the class RobotLoadRecordCommon but only the corresponding interface.

From what i see IRobotLoadRecordCommon only contains the "isautogenerated" field and I don't see the point of using this.

 

Maybe i've not been clear about what I'm trying to achieve : I understand that LoadRecords contains all the parameter to a specified load (such as a point load on a bar, at x=... with fx=... etc...).

I'm trying to extract a case's components to a single static case, and to achieve this, I'm trying to copy the load record of my moving case's component to the newly created case.

 

Thank you again.

Message 4 of 12
Rafal.Gaweda
in reply to: nrdev

                'Next : do i need to copy every parameter one by one or is there a simpler way

Yes, you have to

 

newRec.Objects.AddText oldRec.Objects.ToText

For iii = 0 To 14
newRec.SetValue iii, oldRec.GetValue(iii)
Next iii

 

 

(Autogenerated has nothing to do with it. Sorry)



Rafal Gaweda
Message 5 of 12
nrdev
in reply to: Rafal.Gaweda

Thank you, it seemed more complicated than that.

Although, I still have an error :

 

At the line :

newRec.Objects.AddText oldRec.Objects.ToText

 I get the following error (translated from french) : "The method "GetIdsOfNames" of the object "IRobotLoadRecord2" has failed".

 

If I try to spy on the record, I get "automation errors" as value for the Objects, and ObjectType  properties.

 

Any idea about that ?

 

Regards.

Message 6 of 12
Rafal.Gaweda
in reply to: nrdev

I looked deeper and the answer is : rather not possible, you have to convert them in Robot.

 

The records generated are different records (types) than normal ones used by user.

These records have no objects so it will be hard to convert them correctly by API.

Here is example for point force load in moving load on bar(s) - new nodes must be generated etc

 

Dim RobApp As IRobotApplication
    Set RobApp = New RobotApplication
    Dim RCS As IRobotCaseServer, robCase As IRobotCase, movCase As RobotMobileCase
    Dim Newnodenumber As Long
    
    
    Set RCS = RobApp.Project.Structure.Cases
    Set robCase = RCS.Get(movingCaseId)
    If Not robCase.Type = I_CT_MOBILE Then
        MsgBox "Case " & movingCaseId & " is not a mobileload case"
        Exit Sub
    Else
        Set movCase = robCase
        Dim iComp As Integer, compRecs As RobotLoadRecordMngr, compRec As IRobotLoadRecord, iRec As Integer
        Dim newCase As RobotSimpleCase, newRec As RobotLoadRecord, oldRec As RobotLoadRecord
        
        If movCase.Components.Count = 0 Then
            MsgBox "Moving load case contains no components, please make sure to run the computation to generate components"
            Exit Sub
        End If
        
        For iComp = 1 To movCase.Components.Count
            'Create the new static case
            If RCS.Exist(firstStatic + iComp - 1) Then RCS.Delete firstStatic + iComp - 1
            
            Set newCase = RCS.CreateSimple(firstStatic + iComp - 1, movingCaseId & "/" & iComp, I_CN_EXPLOATATION, I_CAT_STATIC_LINEAR)
            
            Set compRecs = movCase.Components.Get(iComp).Records
            For iRec = 1 To compRecs.Count
                Set oldRec = compRecs.Get(iRec)
                If (oldRec.Type = I_LRT_MOBILE_POINT_FORCE) Then
                    Set newRec = newCase.Records.Create(I_LRT_NODE_FORCE)
                    Newnodenumber = RobApp.Project.Structure.Nodes.FreeNumber
                    RobApp.Project.Structure.Nodes.Create Newnodenumber, oldRec.GetValue(I_MPFRV_X), _
                                                                         oldRec.GetValue(I_MPFRV_Y), _
                                                                         oldRec.GetValue(I_MPFRV_Z)
                    newRec.Objects.AddOne Newnodenumber
                    newRec.SetValue I_NFRV_FX, oldRec.GetValue(I_MPFRV_FX)
                    newRec.SetValue I_NFRV_FY, oldRec.GetValue(I_MPFRV_FY)
                    newRec.SetValue I_NFRV_FZ, oldRec.GetValue(I_MPFRV_FZ)

                End If
            Next iRec
            
        Next iComp
    End If

 



Rafal Gaweda
Message 7 of 12
nrdev
in reply to: Rafal.Gaweda

Hi,

 

I did look a little deeper to and came to the same conclusion that mobile load records don't have objects.

But I found that mobile components have a set of mobile records and a set of normal ones. If I keep only the normal ones, I have some records with objects, but the majority of them don't (Though all records have the right set of forces).

 

Your solution doesn't work because the value returned with the index I_MPFRV_X (or the 2 others) does not contain the coordinate but the force applied on the X axis. I've looked at the values at the indexes 0 to 14 and I dont see any relevant coordinates in theses values.

 

This part of the API really doesn't seem very clean !

 

Regards.

Message 8 of 12
Rafal.Gaweda
in reply to: nrdev


But I found that mobile components have a set of mobile records and a set of normal ones.

 

Check coordinnates of these "normal records" - you may easily see them in combinations table, rather not usable in your case.

 

Your solution doesn't work because the value returned with the index I_MPFRV_X (or the 2 others) does not contain the coordinate but the force applied on the X axis. 

 

Make double check

_X returns coordinate (used to create nodes in my code), _FX force

 



Rafal Gaweda
Message 9 of 12
Rafal.Gaweda
in reply to: Rafal.Gaweda

Hint
I_NFRV_FX = 0
I_MPFRV_FX = 3

 

I told you :  mobile records are not standard ones.



Rafal Gaweda
Message 10 of 12
nrdev
in reply to: Rafal.Gaweda

Ok, thanks for your help all along this topic but this thing has become quite complicated for the things I've been trying to achieve.

I guess I'm gonna try to find some easier way to run my computation !

Message 11 of 12
STGT
in reply to: Rafal.Gaweda

hello,

 

do you know how to make combination of automatically generated load case and some other load case. I was trying but i didn't solve it.

 

If this isn't possible, is there even a way to present sum of these results together?

 

thanks

Message 12 of 12
Rafal.Gaweda
in reply to: STGT

It works as for standard combinations. You may use:
http://forums.autodesk.com/t5/robot-structural-analysis/editing-load-cases-in-excel-api/m-p/3929901#...

or I did not understand your question.


Rafal Gaweda

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

Post to forums  

Autodesk Design & Make Report