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.
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
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
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):
Hi Rafal,
The macro you provided runs, but as soon as it comes to the Resolution command it causes excel to crash.
Have you tried this ?:
Try this (last post in this thread):
Yes, makes no difference. Still crashing the exact same way.
Regards,
Even
What happens if you use diffeent screen capture resolution ?
ScPar.Resolution = I_VSCR_2048
or
ScPar.Resolution = I_VSCR_3072
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
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)
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.
Regards,
Even
Try this:
- open Macro and VB editor, go to references, uncheck Robot Object Modeler 12, save macro\ excell file, close excell, start excell, load the file, activate Robot Object Modeler 12 in references, run macro.
If it does not help try to create screen capture without setting resolution -> what effect?
One more: open robot, create such screen capture manually and report me the effect.
What happens if you use this code:
Sub screen_capture()
Dim mavueRobot As IRobotView3
Set mavueRobot = 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_COPY_TO_CLIPBOARD
mavueRobot.MakeScreenCapture ScPar
robapp.Project.PrintEngine.AddScToReport "capture"
End Sub
Still crash ?
Hi Rafal,
This code does not crash.
The screen capture is not added to the report, but it is i nthe clipboard so can be pasted to a document or image edit programme.
Regards,
Even
Do you use 32 or 64 bit Robot?
One test more. Please find in zttached zip the C# program which generates 4 screen captures. Please start robot, load any file, run this program, generate screen captures and report whether the error appears or not.
I'm pretty sure it is 64 bit robot.
The programme runs fine, and produces 4 screen captures that look to be the correct resolution.
I have not checked such configuration : Office 2007 32 bit and Robot 2012 64 bit. I will check it.
on my side Office 2007 32 bit and Robot 2012 32 bit.
Hi I have Robot 2012 64 bit with Excel 2010 and I can't run macro in my new computer. I did this :
- open Macro and VB editor, go to references, uncheck Robot Object Modeler 12, save macro\ excell file, close excell, start excell, load the file, activate Robot Object Modeler 12 in references, run macro.
but it doesn't work. Do I have to install something else ?
In such case unregister ALL ROBOTS you have installed on your computer by command: path_to_robot.exe / unregserver
eg:
"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2011\System\Exe\robot.EXE" /unRegServer
then
register the one you want to use.
eg:
"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2012\System\Exe\robot.EXE" /RegServer
Can't find what you're looking for? Ask the community or share your knowledge.