Skip to content

Global Parameters

Jacob Myers edited this page May 29, 2026 · 1 revision

Global PyOpticL Parameters

PyOpticL has a number of global parameters that can be used to specify defaults and change the behavior of the library.

To set a parameter, import the settings module from PyOpticL and call the set function of the following form:

from PyOpticL import settings

settings.set_<parameter_name>(...)

For example, to set the measurement system to metric, you would call:

settings.set_measurement_system("metric")

The following parameters are currently available:

  • measurement_system
    Default measurement system, used for switching bolt types (when applicable) and for defining "grid" units of the Dimension class. Options are "imperial" and "metric". Default is "imperial".
  • minimum_thread_engagement
    Minimum thread engagement for bolts, used for calculating the default length of bolts when the length is not specified. Default is 8mm.
  • default_extra_drill_depth
    Clearance depth to drill beyond the length of the bold when creating drilling. Default is 10mm.
  • hidden_object_groups
    List of object groups that should be hidden by default in the FreeCAD viewer. Default is to hide just the "hardware" group.
  • enable_beam_transparency
    Whether to enable transparency for the beam segments in the FreeCAD viewer. Helpful for visualizing beam power, but can hurt performance. Default is False.

Clone this wiki locally