I have a code where I use the SetFit() command. Unfortunately it seems that in the batch mode (closed mechanical) it does not work probably often the images generated are not zoomed in or cut half. Is there an work around.
for view in views:
if m % 3 == 0:
html_content += ' <tr>\n'
m = m+1
Graphics.Camera.SetSpecificViewOrientation(view)
ExtAPI.Graphics.Camera.SetFit()
a= StressResult.AddFigure()
a.Name = a.Parent.Parent.Name+' '+name+' '+str(view)
output_image_path = r"R:\delete_tmp\{0} {1} {2}.png".format(a.Parent.Parent.Name,name,str(view))
Graphics.ExportImage(output_image_path, GraphicsImageExportFormat.PNG, image_settings)
html_content += '<td><img src="{}" alt="Image"></td>\n'.format(output_image_path)
FigureList.append(a)
I also tried
import context_menu
context_menu.SetFit() which did not work either.