To make the file export process more versatile, one method is to export it to the same location as the project file. This script obtains the file path of the opened project file (jproj) and exports an image of the model display.
Preconditions
- A saved project file (jproj) is opened.
- JMAG-Designer is not running in no-window mode. Image export cannot be performed in no-window mode.
Script Function
- Set the view point of model view to an isometric angle.
- Defines the image file name.
- Obtain the folder path from the file path of the opened project file.
- Export the image to the same folder as the opened project file, specifying the size.
In this example, the image size is set to 1,280 pixels width and 960 pixels height.
# Copyright (c) 2026 JSOL CORPORATION
#
# This script is released under the MIT License.
# See the full license text at:
# https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/
import os
app = designer.GetApplication()
def getFolderpathOfOpenedProjectFile():
"""Get folder path of opened jproj file"""
openedJprojFilePath = app.GetProjectPath()
folderPath = os.path.dirname(openedJprojFilePath)
return folderPath
app.View().Iso()
saveFileName = u"test.png"
saveFilePath = os.path.join(getFolderpathOfOpenedProjectFile(), saveFileName)
app.ExportImageWithSize(saveFilePath, 1280, 960)


