• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Robot Structural Analysis

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

    Re: Command VBA Projection Capture of a view

    01-19-2012 03:03 AM in reply to: RG_Adsk

    Ok but my PC is new and I don't have installed any Robot before. I have only installed RSA 2012.

    Please use plain text.
    Product Support
    Posts: 2,527
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    01-19-2012 03:22 AM in reply to: mateaus

    To register it properly please open Command Prompt as Administrator, registsrer robot, check macro.

     

    If it still does not work please respond to e-mail sent to yout from our system



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.
    Distinguished Contributor
    mateaus
    Posts: 117
    Registered: ‎10-10-2011

    Re: Command VBA Projection Capture of a view

    03-29-2012 06:17 AM in reply to: sorgjee

    sorgjee wrote:

    Your EXACT code does not run due to a typo. Even without the typo, and using the rest of the code exactly as you've written, yes, it still crashes.error again.PNG

     

     

     

    Regards,

    Even


    It's the same for me. Robot crash when ask for better resolution.

     

    captures high resolution.PNG

     

    I think it's because my computer is not enough speed. When I do some break in the macro it's working. What do I need in the computer ? 

     

    I'm in windows seven 64bit with ARSA 2012 and Office 2010

    Please use plain text.
    Product Support
    Posts: 2,527
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    03-29-2012 06:29 AM in reply to: mateaus

    Use from time to time DoEvents

    or pause code in some places. Pause function dos not exist in VBA so write your own function - example below

    This function pauses code for 5 seconds

     

    Sub Wait()
        waitTime = 5
        Start = Timer
        While Timer < Start + waitTime
            DoEvents
        Wend
    End Sub

     



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.
    Distinguished Contributor
    mateaus
    Posts: 117
    Registered: ‎10-10-2011

    Re: Command VBA Projection Capture of a view

    03-30-2012 05:59 AM in reply to: RG_Adsk

    Is that possible to ask Robot : "W


    RG_Adsk wrote:

    Use from time to time DoEvents

    or pause code in some places. Pause function dos not exist in VBA so write your own function - example below

    This function pauses code for 5 seconds

     

    Sub Wait()
        waitTime = 5
        Start = Timer
        While Timer < Start + waitTime
            DoEvents
        Wend
    End Sub

     



    hen the generation of the vue is finished, do something else" ?

    Please use plain text.
    Product Support
    Posts: 2,527
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    03-30-2012 06:49 AM in reply to: mateaus

    View generation is one command \ line. After finishing it program steps to another code line. 



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.
    Distinguished Contributor
    mateaus
    Posts: 117
    Registered: ‎10-10-2011

    Re: Command VBA Projection Capture of a view

    03-30-2012 07:11 AM in reply to: RG_Adsk

    RG_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

     

    Please use plain text.
    Product Support
    Posts: 2,527
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    03-30-2012 07:39 AM in reply to: mateaus

    send me whole your xls file and any other files required like mobile loads database etc.



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.
    Distinguished Contributor
    mateaus
    Posts: 117
    Registered: ‎10-10-2011

    Re: Command VBA Projection Capture of a view

    04-10-2012 10:37 AM in reply to: RG_Adsk

    Hi

     

    I've got a problem with the scale in the view. It's not the good one I have to do the command normalize in Robot.

     

    normaliser echelle.PNG

     

    Is there a command in VBA API for this ?

    Please use plain text.
    Product Support
    Posts: 2,527
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    04-11-2012 01:31 AM in reply to: mateaus

    Unfortunately you can not control scale on force normalization thru API.



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.