Discussion Groups

Robot Structural Analysis

Reply
Distinguished Contributor
mateaus
Posts: 117
Registered: ‎10-10-2011

dead weight with a coefficient

159 Views, 7 Replies
11-30-2011 03:02 AM

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 ?

Please use plain text.
Product Support
Artur.Kosakowski
Posts: 4,544
Registered: ‎12-17-2010

Re: dead weight with a coefficient

11-30-2011 06:49 AM 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
Please use plain text.
Distinguished Contributor
mateaus
Posts: 117
Registered: ‎10-10-2011

Re: dead weight with a coefficient

11-30-2011 10:19 AM 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

 

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 4,930
Registered: ‎04-26-2010

Re: dead weight with a coefficient

12-01-2011 12:42 AM in reply to: mateaus

replace 

 

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

by

rc.SetValue(3, coefz) 


Rafal Gaweda
Please use plain text.
Distinguished Contributor
mateaus
Posts: 117
Registered: ‎10-10-2011

Re: dead weight with a coefficient

12-01-2011 03:06 AM 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

 

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 4,930
Registered: ‎04-26-2010

Re: dead weight with a coefficient

12-01-2011 03:13 AM in reply to: mateaus

Try this:

 

rc1.Objects.FromText "1 2 3 4"



Rafal Gaweda
Please use plain text.
Distinguished Contributor
mateaus
Posts: 117
Registered: ‎10-10-2011

Re: dead weight with a coefficient

12-01-2011 04:12 AM in reply to: Rafal.Gaweda

Ok but why this command doesn't work ?

 

rc1.Objects.FromText "tous"

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 4,930
Registered: ‎04-26-2010

Re: dead weight with a coefficient

12-01-2011 04:20 AM 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
Please use plain text.