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 ?
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.
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
replace
rc.SetValue(RobotOM.IRobotDeadRecordValues.I_DRV_COEFF, coefz)
by
rc.SetValue(3, coefz)
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
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"
Can't find what you're looking for? Ask the community or share your knowledge.