MagicDraw 19.0 LTR SP1 Documentation


Application-related options are referred as environment options. If you are using MagicDraw, they are saved in the global.opt file that is located in <user home directory>\AppData\Local\.magicdraw\<version number>\data. The location for other modeling tools developed by No Magic Inc. is adequate. 

You can add custom environment options for your modeling tool.

 

To add your own environment options


  1. Extend the com.nomagic.magicdraw.core.options.AbstractPropertyOptionsGroup class.
  2. Add the extending class to application environment options.

Example of adding custom environment options

	class MyOptionsGroup extends AbstractPropertyOptionsGroup
    {
        ...
    }
    Application application = Application.getInstance(); 
    EnvironmentOptions options = application.getEnvironmentOptions(); 
    options.addGroup(new MyOptionsGroup());

 

Example of accessing environment options

	Application application = Application.getInstance(); 
	EnvironmentOptions options = application.getEnvironmentOptions(); 
	int imageDpi = options.getGeneralOptions().getImageResolutionDpi();

 You can find the code examples in

  • <programinstallation directory>\openapi\examples\environmentoptions

 

  • No labels