[S0013] Change the setting of items in [Tools]-[Preferences]

 

The items in [Tools]-[Preferences] menu of JMAG-Designer is an environment setting item for language, appearance, etc. There are not many situations where script operations are required, but there are times when settings need to be changed, such as when formatting images to attach to reports. This script changes the settings for the appearance of the graphics window among the preferences items.

Preconditions

None

Script Function

  • Change the background color of the graphics window.
    This script uses black.
  • Change the text color.
    This script uses a size of 16 and a color of white.
  • Change the numeric digits notation.
    This script uses decimal formatting with 6 digits after decimal.
  • Turn off the display of maximum and minimum position markers when displaying contours.
# 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/


app = designer.GetApplication()

# Appearance
app.SetPreference(u"TopBackgroundColor", u"Black")
app.SetPreference(u"BottomBackgroundColor", u"Black")

# Text
app.SetPreference(u"TextColor", u"White")
app.SetPreference(u"FontSize", 16)
app.SetPreference(u"DigitsNotationType", 2)
app.SetPreference(u"Precision", 6)

# Layout
app.SetPreference(u"ContourMinPosition", 0)
app.SetPreference(u"ContourMaxPosition", 0)

Download Python source code

How to use script file

Use the JMAG Script Library after reading and agreeing to the following terms of use.

Search Filter

  • All Categories

An engineer's diary
JMAG-Express Online