Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C# API Help Close View

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
chjpcoi
476 Views, 5 Replies

C# API Help Close View

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);

 

 

 

 

 

5 REPLIES 5
Message 2 of 6

hi @chjpcoi

if you don't use it anymore, you could destroy it &H2 0x0002 ?

Best regards

Message 3 of 6

Hi @Stephane.kapetanovic 

Thanks for your answer.  I fixed it by calling application Robot.

Message 4 of 6

Could you explain "calling application robot" ?

Message 5 of 6

Hi @Stephane.kapetanovic 

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);

Message 6 of 6

All is fine.

Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report