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

    Autodesk Robot Structural Analysis

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

    Command VBA Projection Capture of a view

    823 Views, 104 Replies
    10-12-2011 02:50 AM

    Hi,

     

    I have a problem with my macro. The command of projection in 3D doesn't work. My view stay in XZ plane.

     

    robapp.Window.Activate
    Set mavueRobot = robapp.Project.ViewMngr.CreateView(1)
    mavueRobot.Projection = I_VP_3DXYZ


    mavueRobot.Visible = True
    mavueRobot.Redraw (True)

     

    I want also make a capture of my model with diagram of results. Have you an example of code for it ?

     

    I would like to get for final result the exemple in attachment.

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

    Re: Command VBA Projection Capture of a view

    10-12-2011 03:31 AM in reply to: mateaus

    Seems like one line is missing:

     

    mavueRobot.Projection = I_VP_3DXYZ

    robapp.Project.ViewMngr.Refresh

    mavueRobot.Visible = True

     

    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
    Support Specialist
    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

    10-12-2011 10:22 AM in reply to: mateaus

    Ok but it's not working.

     

    See my attachment

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

    Re: Command VBA Projection Capture of a view

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

    It seems like you missed the attachment.



    Artur Kosakowski
    Support Specialist
    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

    10-13-2011 01:01 AM in reply to: Artur.Kosakowski
    Please use plain text.
    Product Support
    Posts: 2,543
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    10-13-2011 01:08 AM in reply to: mateaus

    Hi

     

    Take a look at attached movie



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.
    Product Support
    Posts: 2,543
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    10-13-2011 01:20 AM in reply to: mateaus

    Hi

     

    It seems it is related to your computer graphics card (and maybe also 64 bit Robot). 

    On one of our computers I have the same bahavior.Switching between views (several times), refreshing them manualy etc refreshes view on this viewport.



    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

    10-13-2011 02:24 AM in reply to: RG_Adsk

    The excel file has been created 5 years ago, I don't think this is a problem related to 64 bit Robot.

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

    Re: Command VBA Projection Capture of a view

    10-13-2011 02:28 AM in reply to: mateaus

    mateaus wrote:

    The excel file has been created 5 years ago, 


    No, it was created 09.2001 :-)



    Rafal Gaweda
    Product Support
    Autodesk, Inc.
    Please use plain text.
    Product Support
    Posts: 2,543
    Registered: ‎04-26-2010

    Re: Command VBA Projection Capture of a view

    10-13-2011 05:59 AM in reply to: RG_Adsk

    Update to "your" macro to set map display on view and to make screen capture

    Read comments in code below

     

     

     

    Public Sub CreeVueRM()
    ' définition d'une vue

    robapp.Interactive = True
    robapp.Visible = True
    robapp.Window.Activate


    robapp.Project.CalcEngine.Calculate ' calculate model

     

    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.Selection.Get(I_OT_CASE).FromText ("3") ' selecting case for results display
    mavueRobot.Redraw (True)

    mavueRobot.Projection = I_VP_3DXYZ

    ' displaying map
    mavueRobot.ParamsFeMap.CurrentResult = I_VFMRT_GLOBAL_DISPLACEMENT_Z

    mavueRobot.Visible = True
    mavueRobot.Redraw (True)

    robapp.Project.ViewMngr.Refresh

    ' making screen capture
    Dim ScPar As RobotViewScreenCaptureParams
    Set ScPar = robapp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)

    ScPar.Name = "My screen capture"
    ScPar.UpdateType = I_SCUT_UPDATED_UPON_PRINTING
    mavueRobot.MakeScreenCapture ScPar

    End Sub



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