• 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

    10-14-2011 03:11 AM in reply to: RG_Adsk

    OK thanks a lot

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

    Re: Command VBA Projection Capture of a view

    11-10-2011 01:07 AM in reply to: RG_Adsk

    Hi I would like to make a zoom of my picture because I can't anything on my screen capture. I wrote this command but it's not good written. Would you mind correct it ?

     

    mavueRobot.GetZoom(2, 2, 2, 2) = 1

     

    I would like make a zoom of 150%.

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

    Re: Command VBA Projection Capture of a view

    11-10-2011 06:32 AM in reply to: mateaus

    It is not that easy because zoom depends on real coordinates and viewport size \ aspect ratio.

     

    Small 2d example below. Left top corner is important and vieport aspect ratio

     

    zoom2d.JPG

     

    3d example  (left top corner is related to left top corner on ZX plain view) ; additionally you should define rotation point and rotation angle

    z3d2.JPG



    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

    11-14-2011 04:01 AM in reply to: RG_Adsk

    Hi it did'nt work.

     

    I send you a video which show what I want to do ?

     

    Would you mind send me the command of VBA to write in the macro for it ?

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

    Re: Command VBA Projection Capture of a view

    11-14-2011 05:49 AM in reply to: mateaus

    Try this - change zoomfactor:

     

     

     

    Set RobApp = New RobotApplication

     


    Dim viewRobot As IRobotView3

    Set viewRobot = RobApp.Project.ViewMngr.GetView(1)

     viewRobot.Redraw (True)

    viewRobot.Projection = I_VP_XY

    viewRobot.ParamsFeMap.CurrentResult = I_VFMRT_DETAILED_MOMENT_XY

    RobApp.Project.ViewMngr.Refresh

     

    Dim l As Double, t As Double, b As Double, r As Double
    l = 0
    t = 0
    b = 0
    r = 0

    viewRobot.GetZoom l, t, r, b

    Dim CenterX As Double
    Dim CenterY As Double
    Dim VX As Double
    Dim VY As Double

    CenterX = (l + r) / 2
    CenterY = (t + b) / 2

     

    Dim zoomfacfor As Double
    zoomfactor = 2
    VX = Abs(l - CenterX) / zoomfactor
    VY = Abs(t - CenterY) / zoomfactor

    viewRobot.SetZoom CenterX + VX, CenterY + VY, CenterX - VX, CenterY - VY


    RobApp.Project.ViewMngr.Refresh



    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

    11-14-2011 08:47 AM in reply to: RG_Adsk

    It doesn't change anything in the view. Have a look to the video.

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

    Re: Command VBA Projection Capture of a view

    11-14-2011 10:53 AM in reply to: mateaus

    mateaus wrote:

    It doesn't change anything in the view. Have a look to the video.


    viewRobot.SetZoom CenterX + VX, CenterY + VY, CenterX - VX, CenterY - VY


    viewRobot.Redraw(True) ' <- I have not used this command, take a look in my code or use   ...Redraw(0)


    RobApp.Project.ViewMngr.Refresh

     

     



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

    Re: Command VBA Projection Capture of a view

    11-14-2011 11:23 AM in reply to: RG_Adsk

    http://forums.autodesk.com/t5/Autodesk-Robot-Structural/Zoom-All-via-API/td-p/3221266 ->

     

    .Redraw(1) ~ ZoomAll



    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

    11-15-2011 04:24 AM in reply to: RG_Adsk

    I don't understand what does mean left, top, right and bottom for the command getzoom ?

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

    Re: Command VBA Projection Capture of a view

    11-15-2011 04:29 AM in reply to: mateaus

    Take  a look at my screen shots in message 23 in this thread



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