@Anonymous_Adsk wrote:
View generation is one command \ line. After finishing it program steps to another code line.
So how explain that robot crash if I don't put sleeping times :
Sleep 33000 '33 secondes to generate a view of mobile loads
Sub cree_vues_resultats()
If Not Robapp.Visible Then
Set Robapp = Nothing
MsgBox "Open Robot", vbOKOnly, "ERROR"
Exit Sub
End If
fichier_sortie = Range("AE16").Value
Dim mavueRobot As IRobotView3 ' this is important to set IRobotView3 if you want to make screen capture of this view
Set mavueRobot = Robapp.Project.ViewMngr.GetView(1) ' it seems CreateView makes this strange affect, use GetView instead
mavueRobot.ParamsDisplay.Set 68, False 'symbole charges ponctuelles
mavueRobot.ParamsDisplay.Set 69, False 'symbole charges lineaires
mavueRobot.ParamsDisplay.Set 70, False 'symbole charges surfaciques
mavueRobot.Projection = I_VP_XY_3D
'mavueRobot.Projection = I_VP_3DXYZ
mavueRobot.ParamsDisplay.Set I_VDA_OTHER_RULER, True
Robapp.Project.ViewMngr.Refresh
'faire un zoom
Sheets("Sommaire").Select
transvfactor = Range("I32").Value
transhfactor = Range("I31").Value
zoomfactor = Range("I30").Value
Call zoom_robot
'mavueRobot.Visible = True
'mavueRobot.Redraw (True)
'Robapp.Project.ViewMngr.Refresh
'MsgBox ("Regler la vue dans le modèle")
Sheets("Sommaire").Select
casprem = Range("N18").Value
casder = Range("N19").Value
prem_cas_roul = Range("N17").Value + 1
For i = casprem To casder
Cas = i
mavueRobot.ParamsFeMap.WithDescription = True
mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_SYMBOLS, False
If Range("I21").Value = "Myy +" Then
mavueRobot.ParamsFeMap.CurrentResult = I_VFMRT_COMPLEX_REINFORCE_TOP_MYY
sollicitation = "Moments Myy+"
'pour les charges roulantes attention
If i >= prem_cas_roul Then
Cas = prem_cas_roul + (casder - prem_cas_roul + 1) * 3 + ((i - prem_cas_roul) * 2 + 0)
End If
End If
If Range("I21").Value = "Mxx +" Then
mavueRobot.ParamsFeMap.CurrentResult = I_VFMRT_COMPLEX_REINFORCE_TOP_MXX
sollicitation = "Moments Mxx+"
'pour les charges roulantes attention
If i >= prem_cas_roul Then
Cas = prem_cas_roul + (casder - prem_cas_roul + 1) * 3 + ((i - prem_cas_roul) * 2 + 0)
End If
End If
If Range("I21").Value = "Myy -" Then
mavueRobot.ParamsFeMap.CurrentResult = I_VFMRT_COMPLEX_REINFORCE_BOTTOM_MYY
sollicitation = "Moments Myy-"
'pour les charges roulantes attention
If i >= prem_cas_roul Then
Cas = prem_cas_roul + (casder - prem_cas_roul + 1) * 3 + ((i - prem_cas_roul) * 2 + 1)
End If
End If
If Range("I21").Value = "Mxx -" Then
mavueRobot.ParamsFeMap.CurrentResult = I_VFMRT_COMPLEX_REINFORCE_BOTTOM_MXX
sollicitation = "Moments Mxx-"
'pour les charges roulantes attention
If i >= prem_cas_roul Then
Cas = prem_cas_roul + (casder - prem_cas_roul + 1) * 3 + ((i - prem_cas_roul) * 2 + 1)
End If
End If
mavueRobot.Selection.Get(I_OT_CASE).FromText (Cas) ' selecting case for results display
ecran_capture = sollicitation & "_ Cas " & i
mavueRobot.Redraw (0)
Sleep 33000 '33 secondes to generate a view of mobile loads
Robapp.Project.ViewMngr.Refresh
Call screen_capture
Next i
'saving printout \ report to file
'robapp.Project.PrintEngine.SaveReportToFile fichier_sortie, I_OFF_RTF_JPEG
Robapp.Project.PrintEngine.SaveReportToFile fichier_sortie, I_OFF_RTF
'or directly opening printout in Word
Robapp.Project.PrintEngine.ExternalPreviewReport EPF_MS_OFFICE
'MsgBox "QUITTER APPLICATION ROBOT"
Sleep 10000
Robapp.Quit I_QO_DISCARD_CHANGES ' Quitter sans sauvegarde
End Sub