Discussion Groups

Robot Structural Analysis

Reply
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: Command VBA Projection Capture of a view

10-14-2011 03:11 AM in reply to: Rafal.Gaweda

OK thanks a lot

Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: Command VBA Projection Capture of a view

11-10-2011 01:07 AM in reply to: Rafal.Gaweda

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%.

Product Support
5,740 Posts
1,305 Kudos
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
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: Command VBA Projection Capture of a view

11-14-2011 04:01 AM in reply to: Rafal.Gaweda

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 ?

Product Support
5,740 Posts
1,305 Kudos
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
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: Command VBA Projection Capture of a view

11-14-2011 08:47 AM in reply to: Rafal.Gaweda

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

Product Support
5,740 Posts
1,305 Kudos
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
5,740 Posts
1,305 Kudos
Registered: ‎04-26-2010

Re: Command VBA Projection Capture of a view

11-14-2011 11:23 AM in reply to: Rafal.Gaweda
Distinguished Contributor
120 Posts
0 Kudos
Registered: ‎10-10-2011

Re: Command VBA Projection Capture of a view

11-15-2011 04:24 AM in reply to: Rafal.Gaweda

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

Product Support
5,740 Posts
1,305 Kudos
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