Discussion Groups

Robot Structural Analysis

Reply
Active Contributor
sorgjee
Posts: 49
Registered: ‎12-11-2011

Re: Command VBA Projection Capture of a view

01-10-2012 07:48 AM in reply to: Rafal.Gaweda

Hi Rafal,

 

Using the below command with Robot 12 and Excel 2007 causes excel to crash. Is this a known issue?

    ScPar.Resolution = I_VSCR_4096

 

Regards,

Even

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,048
Registered: ‎04-26-2010

Re: Command VBA Projection Capture of a view

01-11-2012 12:51 AM in reply to: sorgjee

 

Using the below command with Robot 12 and Excel 2007 causes excel to crash. Is this a known issue?

    ScPar.Resolution = I_VSCR_4096

 

It should work.

 

Public robapp As RobotApplication

 

Private Sub CommandButton1_Click()

 

Set robapp = New RobotApplication

 

Dim viewRobot As IRobotView3 ' this is important to set IRobotView3 if you want to make screen capture of this view

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

 

viewRobot.Projection = I_VP_3DXYZ

viewRobot.Redraw (True)

robapp.Project.ViewMngr.Refresh

 

Call screen_capture


End Sub


Sub screen_capture()

 

Dim viewRobot As IRobotView3
Set viewRobot = robapp.Project.ViewMngr.GetView(1)
Dim ScPar As RobotViewScreenCaptureParams
Set ScPar = robapp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)

 

ScPar.Name = "capture"
ScPar.UpdateType = I_SCUT_CURRENT_VIEW
ScPar.Resolution = I_VSCR_4096
viewRobot.MakeScreenCapture ScPar
robapp.Project.PrintEngine.AddScToReport "capture"

 

End Sub

 

 


Try this (last post in this thread):

 

http://forums.autodesk.com/t5/Autodesk-Robot-Structural/VBA-Excel-macro-for-any-object-geometry-modi...




Rafal Gaweda
Please use plain text.
Active Contributor
sorgjee
Posts: 49
Registered: ‎12-11-2011

Re: Command VBA Projection Capture of a view

01-11-2012 01:22 AM in reply to: Rafal.Gaweda

Hi Rafal,

 

The macro you provided runs, but as soon as it comes to the Resolution command it causes excel to crash.

 

excel error.PNG

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,048
Registered: ‎04-26-2010

Re: Command VBA Projection Capture of a view

01-11-2012 01:32 AM in reply to: sorgjee

Have you tried this ?:

 

 

Try this (last post in this thread):

 

http://forums.autodesk.com/t5/Autodesk-Robot-Structural/VBA-Excel-macro-for-any-object-geometry-modi...





Rafal Gaweda
Please use plain text.
Active Contributor
sorgjee
Posts: 49
Registered: ‎12-11-2011

Re: Command VBA Projection Capture of a view

01-11-2012 04:08 AM in reply to: Rafal.Gaweda

Yes, makes no difference. Still crashing the exact same way.

 

Regards,

Even

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,048
Registered: ‎04-26-2010

Re: Command VBA Projection Capture of a view

01-11-2012 08:28 AM in reply to: sorgjee

What happens if you use diffeent screen capture resolution ?

 

ScPar.Resolution = I_VSCR_2048

 

or


ScPar.Resolution = I_VSCR_3072

 

 



Rafal Gaweda
Please use plain text.
Active Contributor
sorgjee
Posts: 49
Registered: ‎12-11-2011

Re: Command VBA Projection Capture of a view

01-11-2012 08:30 AM in reply to: Rafal.Gaweda

Same crash for excel.

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,048
Registered: ‎04-26-2010

Re: Command VBA Projection Capture of a view

01-11-2012 08:41 AM in reply to: Rafal.Gaweda

What is sisplayed after running this macro in Excell cells:

 

Private Sub Ver()

 

Dim robapp As RobotApplication

Set robapp = New RobotApplication

 

Cells(1, 1) = robapp.Version
Cells(2, 1) = robapp.ProgramVersion

 

End Sub



Rafal Gaweda
Please use plain text.
Active Contributor
sorgjee
Posts: 49
Registered: ‎12-11-2011

Re: Command VBA Projection Capture of a view

01-11-2012 08:58 AM in reply to: Rafal.Gaweda

It comes out as:

12
25.0.3.3833
Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,048
Registered: ‎04-26-2010

Re: Command VBA Projection Capture of a view

01-12-2012 12:31 AM in reply to: sorgjee

Please try my EXACT code - published a few posts earlier.

Do not modify it.

I can see in your screen capture that in your screen_capture sub you create again robapp (which is already created by main function in my code)



Rafal Gaweda
Please use plain text.