API - Robot - Linear acceleration and angular acceleration

API - Robot - Linear acceleration and angular acceleration

Anonymous
Not applicable
1,142 Views
4 Replies
Message 1 of 5

API - Robot - Linear acceleration and angular acceleration

Anonymous
Not applicable

[ENGLISH]

Hi,

 

I create a VBA macro "Test_Charge" to apply linear acceleration and angular acceleration ("Two functions") on structural element. When i run my application, Robot create the load but don't apply on the selection. In the debug, "Debug.Print rec.Objects.Count" and "Debug.Print rec.Objects.ToText" give me the right selection.

 

Could you help me to understand.

I attach Load table picture.

 

(Note : I m on Autodesk Robot  2013)

 

[FRENCH]

Bonjour,

 

J 'ai crée une macro VB "Test_charge" pour appliquer un vecteur d'accélération linéaire et / angulaire sur des parties de structure. La création fonctionne hormis pour l'affectation aux éléments. La case est vide. Quand je vérifie pendant l'execution du programme le nombre et la selection des éléments, j'ai les bonnes valeurs. 

 

Pouvez vous m'aider ?

Ci-joint la copie d'ecran de robot 2013

 

 

Option Explicit
'***********************************
'
'       Déclaration des variables
'
'***********************************
    
    'Déclaration de l'objet Application Robot
    Dim Robapp As IRobotApplication
    
Function Linear_acc(smpl_cas As IRobotSimpleCase, ByVal AccX As Double, ByVal AccY As Double, ByVal AccZ As Double, ByVal descriptionLR As String, ByVal SelectionObject As String)

Dim selectionB As RobotSelection
Dim rec As RobotLoadRecord
    Set rec = smpl_cas.Records.Create(89) '89 = Force d'inertie
        
        
        'Texte de description
        rec.Description = descriptionLR
        
        'Charge appliqué à la selection
        rec.ObjectType = I_OT_BAR
        
        rec.Objects.Clear
        
        Set selectionB = Robapp.Project.Structure.Selections.Create(I_OT_BAR)
        selectionB.FromText (SelectionObject)
         
        rec.Objects.Add selectionB
        Debug.Print rec.Objects.Count
        Debug.Print rec.Objects.ToText
        
        'paramètre de la charge d'inertie
        rec.SetValue 0, AccX
        rec.SetValue 1, AccY
        rec.SetValue 2, AccZ
        
        rec.SetValue 12, 0 '(Masse = 1 ou Objet = 0)
        rec.SetValue 13, 0 '(Relative = 1 ou abolue = 0)

        'INERTIE 3:EXP / forces d'inertie / AX=0.0  AY=0.0  AZ=0,0  / objets_masses  / absolues / MEMO :
        
    Set selectionB = Nothing
    Set rec = Nothing

End Function

Function Angular_acc(smpl_cas As IRobotSimpleCase, ByVal AccX As Double, ByVal AccY As Double, ByVal AccZ As Double, ByVal CoordX As Double, ByVal CoordY As Double, ByVal CoordZ As Double, ByVal descriptionLR As String, ByVal SelectionObject As String)
     
Dim selectionB As RobotSelection
Dim rec As RobotLoadRecord
    Set rec = smpl_cas.Records.Create(90) '90 = Force centrifuge
        
        
        'Texte de description
        rec.Description = descriptionLR
        rec.SetValue 12, 0 '(Masse = 1 ou Objet = 0)
        
    Set selectionB = Robapp.Project.Structure.Selections.Get(I_OT_BAR)
        selectionB.FromText (SelectionObject)
        
        'Charge appliqué à la selection
        rec.ObjectType = I_OT_BAR
                
        rec.Objects.Clear
        rec.Objects.FromText SelectionObject
        Debug.Print rec.Objects.Count
        Debug.Print rec.Objects.ToText
        
        'paramètre de la charge d'inertie
        rec.SetValue 0, 0 'VX=0.0
        rec.SetValue 1, 0 'VY=0.0
        rec.SetValue 2, 0 'VZ=0.0
        rec.SetValue 3, AccX 'AX=0.0
        rec.SetValue 4, AccY 'AY=0.0
        rec.SetValue 5, AccZ 'AZ=0.0
        rec.SetValue 6, CoordX  'X=0.0
        rec.SetValue 7, CoordY  'Y=0.0
        rec.SetValue 8, CoordZ  'Z=0.0
       
        'ACCELERATION ANGULAIRE / 3:EXP / forces centrifuges et accélération angulaire / VX=0.0  VY=0.0  VZ=0.0  AX=0.0  AY=0.0  AZ=0.0 /  X=0.0 Y=0.0 Z=0.0 / objets_masses / MEMO :

        
    Set selectionB = Nothing
    Set rec = Nothing

End Function

Sub Test_Charge()

Dim Cas As IRobotCase
Dim CaseNumber As Long
Dim Simple_cas As IRobotSimpleCase

Set Robapp = New RobotApplication

CaseNumber = 3
Set Cas = Robapp.Project.Structure.Cases.Get(CaseNumber)

If Cas.Type = I_CT_SIMPLE Then
    Set Simple_cas = Cas
                    
    Angular_acc Simple_cas, 0, 0, 10, 0, 0, 0, "Force centrifuge", "1501"
    Linear_acc Simple_cas, 1.2, 0, -15.3, "Force d'inertie", "Tous"

End If

Set Cas = Nothing
Set Simple_cas = Nothing
Set Robapp = Nothing
    
End Sub

 

 

 

 

 

 

 

0 Likes
Accepted solutions (1)
1,143 Views
4 Replies
Replies (4)
Message 2 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support
Body forces and Centrifugal Forces are not implemented in Robot API


Rafal Gaweda
0 Likes
Message 3 of 5

Anonymous
Not applicable

On API documentation, I have seen that nothing is written on these load types. I get load parameters by looping through the attributes.
I don't understand why i can create Centrifugal Forces with good acceleration but not apply on element. It cause a very big problem on this project. I have 24 models and 5 cases of centrifugal forces for each model. I'm a bit desperate. For automation, this problem will complicat my task.

 

 

 

0 Likes
Message 4 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

In fact you are right.
They are implemented but without any documentation.
And unfortunately it is not possible to set object list for them.
It must be corrected by developers.
Thank You for pointing that out.



Rafal Gaweda
Message 5 of 5

Anonymous
Not applicable

Thank you for your reply. 
I hope this will be corrected for other people.

0 Likes