Hello Everyone.
I have used below code to automatically close selected view, but somehow when I run this code, other views and Robot are also closed. can you help me to solve this problem?
Thank for the help.
Code:
RobotApplication rbApp = new RobotApplication();
RobotStructure struc = rbApp.Project.Structure;
IRobotView3 viewRobot = (IRobotView3)rbApp.Project.ViewMngr.CreateView(IRobotViewType.I_VT_STANDARD);
viewRobot.Selection.Set(IRobotObjectType.I_OT_PANEL, rbSelectPanels);
viewRobot.Visible = -1;
viewRobot.Redraw(0);
rbApp.Interactive = 0;
viewRobot.Selection.Get(IRobotObjectType.I_OT_CASE).FromText(cas);
viewRobot.Projection = IRobotViewProjection.I_VP_XY_3D;
viewRobot.GridVisible = 0;
viewRobot.ParamsDisplay.SymbolSize = 3;
viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_FE_PANEL_INTERIOR, true);
viewRobot.ParamsDisplay.Set(IRobotViewDisplayAttributes.I_VDA_FE_FE_INTERIOR, true);
rbApp.Interactive = 1;
rbSelectPanels.Clear();
rbApp.Project.ViewMngr.Refresh();
RobotViewScreenCaptureParams scPar = rbApp.CmpntFactory.Create(IRobotComponentType.I_CT_VIEW_SCREEN_CAPTURE_PARAMS);
scPar.Name = item;
scPar.Resolution = IRobotViewScreenCaptureResolution.I_VSCR_4096;
scPar.UpdateType = IRobotViewScreenCaptureUpdateType.I_SCUT_CURRENT_VIEW;
viewRobot.MakeScreenCapture(scPar);
Thread.Sleep(5000);
rbApp.Project.PrintEngine.SaveReportToFile(@"D:\chjcoi\2.API\API Robot\All\Pic tesst\" + item+nameCas[1]+".rtf",
IRobotOutputFileFormat.I_OFF_RTF_JPEG);
Thread.Sleep(5000);
viewRobot.Window.SendMessage(0x0010, 0, 0);
Solved! Go to Solution.
Solved by chjpcoi. Go to Solution.
Thanks for your answer. I fixed it by calling application Robot.
when i do the loop, when i close the view i have to initialize it again application (code below)
rbApp = new RobotApplication();
struc = rbApp.Project.Structure;
rbSelectPanels = struc.Selections.Get(IRobotObjectType.I_OT_OBJECT);
Can't find what you're looking for? Ask the community or share your knowledge.