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.
Is there a way to access the results map scale normalize button using API?
No, there is not.
If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.
Ok thanks.
I'm also trying to output a panel local axis direction vector using "GetDirX" function. It seems the function will only output 0, 0, 0? Can you tell me what I'm doing wrong?
Dim xVec As Double, yVec As Double, zVec As Double
With FEparams
.Panel = PanelCol.Get(ii).Number
.GetDirX xVec, yVec, zVec
End With
Thanks.
Dim RSel As RobotSelection Set RSel = RobApp.Project.Structure.Selections.CreateFull(I_OT_PANEL) Dim PanelCol As RobotObjObjectCollection Set PanelCol = RobApp.Project.Structure.Objects.GetMany(RSel) Dim X As RobotGeoPoint3D, Y As RobotGeoPoint3D, Z As RobotGeoPoint3D Dim Obj As RobotObjObject Set X = RobApp.CmpntFactory.Create(I_CT_GEO_POINT_3D) Set Y = RobApp.CmpntFactory.Create(I_CT_GEO_POINT_3D) Set Z = RobApp.CmpntFactory.Create(I_CT_GEO_POINT_3D) For ii = 1 To PanelCol.Count Set Obj = PanelCol.Get(ii) Obj.Main.Attribs.GetLCS X, Y, Z Cells(12 + ii, 3) = Obj.Number Cells(12 + ii, 4) = "LCS X=" + Str(X.X) + ";" + Str(X.Y) + ";" + Str(X.Z) Cells(12 + ii, 5) = "LCS Y=" + Str(Y.X) + ";" + Str(Y.Y) + ";" + Str(Y.Z) Cells(12 + ii, 6) = "LCS Z=" + Str(Z.X) + ";" + Str(Z.Y) + ";" + Str(Z.Z) Next ii
Obj.Main.Attribs.GetLCS X, Y, Z
.GetLCS isn't available or mentioned anywhere in the API user guide. I'm using Robot 2014 Professional. Is there any other method for this version?
Thanks.
In this version you can get only local X
Dim X As Double, Y As Double, Z As Double Obj.Main.Attribs.GetDirX X, Y, Z
@Rafal.Gaweda could you have a look to the code that you wrote some years ago...seems doesn't work.
There are a lot of posts and I'm getting confuse. Is it possible to have just the code for having a screenshot from Robot please?
Hi @Anonymous
Example code
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
@Rafal.Gaweda Why do I get several screen (around 12), I would like to get just one!
Hi @Anonymous
Delete all screen captures from the file, try your code, if needed debug your code.
@Rafal.Gaweda I still get several picture.
I'm trying to get a screen in a path like that:
RobApp.Project.PrintEngine.ScreenCaptures "c:\test1.jpeg", I_OFF_RTF_JPEG
or
RobApp.Project.PrintEngine.SaveReportToFile "c:\test2.jpeg", I_OFF_RTF_JPEG
Both lines don't work!
HI @Anonymous
Files extensions should be rtf
fichier_sortie = "d:\prb\outjpg.rtf" RobApp.Project.PrintEngine.SaveReportToFile fichier_sortie, I_OFF_RTF_JPEG fichier_sortie = "d:\prb\out.rtf" RobApp.Project.PrintEngine.SaveReportToFile fichier_sortie, I_OFF_RTF
Hi @Anonymous
Is it no possible to get a picture file instead of rtf?
No
@Rafal.Gaweda what about excel? Is it possible to get a screen from Robot in the excel file?
Hi @Anonymous
You may try (I personally have never checked it) to make screen capture to clipboard and then paste it in Excel
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 ScPar.UpdateType = I_SCUT_COPY_TO_CLIPBOARD view.MakeScreenCapture ScPar
Hi @Rafal.Gaweda,
I want screen captures for MXX,MYY and so on (sectional forces and moments) for the structure that I have. I want to just save these screen captures in jpeg format in a folder so that I can use them later.
I have written the following code:
IRobotView3 mavuerobot = Robapp.Project.ViewMngr.GetView(1) as IRobotView3;
mavuerobot.Selection.Get(IRobotObjectType.I_OT_CASE).FromText("1");
mavuerobot.Redraw(1);
mavuerobot.Projection = IRobotViewProjection.I_VP_3DXYZ;
mavuerobot.ParamsFeMap.CurrentResult = IRobotViewFeMapResultType.I_VFMRT_DETAILED_MOMENT_XX;
mavuerobot.Visible = 1;
mavuerobot.Redraw(1);
Robapp.Project.ViewMngr.Refresh();
RobotViewScreenCaptureParams ScPar = Robapp.CmpntFactory.Create(IRobotComponentType.I_CT_VIEW_SCREEN_CAPTURE_PARAMS);
ScPar.Name = "First capture";
ScPar.UpdateType =IRobotViewScreenCaptureUpdateType.I_SCUT_CURRENT_VIEW;
ScPar.Resolution =IRobotViewScreenCaptureResolution.I_VSCR_4096;
mavuerobot.MakeScreenCapture(ScPar);
Could you please help me as to how I should save the screen capture in .jpeg now? And I am correctly capturing the screen capture for panel MXX through the above code?
Hi @Anonymous
I hope my answer in post 135 is clear enough.
Hi @Rafal.Gaweda,
Thank you for your response
How do I take the screen capture and put it in an Excel file?
Can't find what you're looking for? Ask the community or share your knowledge.