

Section 2.3.2 Adding a Macro and Its Information. Click Save to open the Macro Information dialog (Figure 7) and follow the steps described in

Click Run to test and make sure that the source code works properly.5. The Environment Options dialog will open (Figure 2).įigure 1 - Environment Options Dialog MenuĢ. Click Options > Environment on the MagicDraw main menu (Figure 1). Use the Environment Options dialog to select a default macro language.ġ.

Macro Engine for MagicDraw works with Java 6.0. Macro Engine comes with Professional, Architect, and Enterprise Editions starting from MagicDraw version 16.6 and greater. You can find MagicDraw Open API in MagicDraw OpenAPI UserGuide.pdf in the manual directory and sample macros in /samples/product features/macros. With Macro Engine, you can control everything that is allowed in Open API, for example, transforming and manipulating models.

IntroductionMacro Engine (previously called Script Engine) in MagicDraw allows you to create your own macro (script) by using BeanShell, Groovy, JRuby, JavaScript, or Jython. Working with Macro Engine 2Ģ.1 Selecting a Default Macro Language 22.2 Creating a Macro 42.3 Adding a Macro, Entering and Editing Macro Information 5Ģ.3.1 Opening Macro Information Dialog 52.3.2 Adding a Macro and Its Information 72.3.3 Editing Macro Information 112.3.4 Macro Information Dialog Mnemonic Keys 12Ģ.4 Deleting and Executing Macros 122.4.1 Deleting a Macro 122.4.2 Executing a Macro 132.4.3 Organize Macros Dialog Mnemonic Keys 15Ģ.5 Macro Keyboard Shortcuts 172.5.1 Assigning a Keyboard Shortcut to a Macro 192.5.2 Removing a Keyboard Shortcut from a Macro 19Ģ.6 Opaque Objects 202.6.1 Getting an Opaque Object 202.6.2 Getting Element Property Values 212.6.3 Setting Element Property Values 222.6.4 Getting the Child of an Element 252.6.5 Getting the Owner of an Element 262.6.6 Creating a New Element 262.6.7 Creating a Relationship Between Elements 262.6.8 Removing an Element 262.6.9 Adding a Stereotype to an Element 272.6.10 Removing a Stereotype from an Element 272.6.11 Printing Element Details 27ģ.1 Using Code Completion to Develop BeanShell Scripts 303.2 Using NetBeans IDE to Develop Groovy Scripts 313.3 Using Eclipse to Develop Groovy Scripts 333.4 Installing Gems for JRuby 333.5 Adding a Scripting Language to MagicDraw 35ģ.5.1 Script Filename Extension Filter 35ġ.
