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: 

dead weight with a coefficient

7 REPLIES 7
Reply
Message 1 of 8
mateaus
431 Views, 7 Replies

dead weight with a coefficient

How can I create this load with Robot API ?

 

I would like the load of dead weight with a coefficient.

 

10:charge verticale poids propre 1A5 Partie de la structure -Z Coef=0.20 MEMO :

 

I think it's not possible with text file.

 

Can you give me the macro for VB please ?

7 REPLIES 7
Message 2 of 8
Artur.Kosakowski
in reply to: mateaus

Try  the following one please:

 

            Dim ra As New RobotOM.RobotApplication

            Dim sc As RobotOM.RobotSimpleCase

            Dim rc As RobotOM.RobotLoadRecordDead

            sc = ra.Project.Structure.Cases.CreateSimple(10, "charge verticale", RobotOM.IRobotCaseNature.I_CN_PERMANENT, RobotOM.IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR)

            rc = sc.Records.Get(sc.Records.[New](RobotOM.IRobotLoadRecordType.I_LRT_DEAD))

            rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_COEFF, 0.2)

            rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_ENTIRE_STRUCTURE, 0)

            rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_Z, -1)

            rc.Objects.FromText("1 2 3 4 5")

 

If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.



Artur Kosakowski
Message 3 of 8
mateaus
in reply to: mateaus

I_DRV_COEFF doesn't exist. Is it new ? I don't have Robot Pro 2012, I have Robot Pro 2011.

 

My macro

 

Sub poids_propre_coef()
    
    Dim ra As New RobotOM.RobotApplication
    Dim cas As RobotOM.RobotSimpleCase
    Dim rc As RobotOM.RobotLoadRecordDead
    Set cas = Loads.Get(nocasdecharge)
  ' sc = ra.Project.Structure.Cases.CreateSimple(10, "charge verticale", RobotOM.IRobotCaseNature.I_CN_PERMANENT, RobotOM.IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR)
    rc = sc.Records.Get(cas.Records.[New](RobotOM.IRobotLoadRecordType.I_LRT_DEAD))
    
 
 If coefx = 0 Then
    If coefz = 0 Then
    MsgBox "Pas de coef pour la charge de poids propre!", vbOKOnly + vbExclamation, "INVALID FOLDER"
    Exit Sub
    Else
'    rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_COEFF, coefz) = True
    rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_Z, DirZ) = True
    End If
 Else

' rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_COEFF, coefx) = True
 rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_X, dirx) = True
    
 End If
 
    rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_ENTIRE_STRUCTURE, 0) = True
    rc.Objects.FromText ("Tous")

End sub

 

Message 4 of 8
Rafal.Gaweda
in reply to: mateaus

replace 

 

rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_COEFF, coefz) 

by

rc.SetValue(3, coefz) 


Rafal Gaweda
Message 5 of 8
mateaus
in reply to: mateaus

This command doesn't work.

rc1.Objects.FromText ("1 2 3 4 5")

 

Sub poids_propre_coef()

Dim Loads As RobotCaseServer
Set Loads = robapp.Project.Structure.Cases
'    Dim ra As New RobotOM.RobotApplication
    Dim cas As RobotSimpleCase
    Dim rc As RobotLoadRecordMngr
    Dim rc1 As RobotLoadRecordDead
    
    Set cas = Loads.Get(nocasdecharge)
  ' sc = ra.Project.Structure.Cases.CreateSimple(10, "charge verticale", RobotOM.IRobotCaseNature.I_CN_PERMANENT, RobotOM.IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR)
  '  rc = cas.Records.Get(cas.Records.New(IRobotLoadRecordType.I_LRT_DEAD))
  Set rc = cas.Records
  i = rc.New(I_LRT_DEAD)
  Set rc1 = rc.Get(i)
  
rc1.Objects.FromText ("1 2 3 4 5")
 
 If coefx = 0 Then
    If coefz = 0 Then
    MsgBox "Pas de coef pour la charge de poids propre!", vbOKOnly + vbExclamation, "INVALID FOLDER"
    Exit Sub
    Else
    rc1.SetValue 3, coefz
    rc1.SetValue I_DRV_ENTIRE_STRUCTURE, 0
    rc1.SetValue I_DRV_Z, DirZ
'    rc1.Objects.FromText ("1 2 3 4 5")
    End If
 Else

 rc1.SetValue 3, coefx
 rc1.SetValue I_DRV_ENTIRE_STRUCTURE, 0
 rc1.SetValue I_DRV_X, dirx
' rc1.Objects.FromText ("1 2 3 4 5")
    
 End If
 

   
    Set rc = Nothing
    Set rc1 = Nothing
    Set cas = Nothing

End Sub

 

Message 6 of 8
Rafal.Gaweda
in reply to: mateaus

Try this:

 

rc1.Objects.FromText "1 2 3 4"



Rafal Gaweda
Message 7 of 8
mateaus
in reply to: Rafal.Gaweda

Ok but why this command doesn't work ?

 

rc1.Objects.FromText "tous"

Message 8 of 8
Rafal.Gaweda
in reply to: mateaus

This command should work in Frencha language version of ARSA

 

try this code for french and english:

 

rc1.Objects.AddText "tous"

rc1.Objects.AddText "all"



Rafal Gaweda

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

Post to forums  

Autodesk Design & Make Report