0700 Working With Macros - Macros

download 0700 Working With Macros - Macros

of 46

Transcript of 0700 Working With Macros - Macros

  • 8/9/2019 0700 Working With Macros - Macros

    1/46

      Macros

    EPLAN Training 1

    Macros

  • 8/9/2019 0700 Working With Macros - Macros

    2/46

      Macros

    EPLAN Training 2

    1  Creating Macro Projects...............................................................................3 

    Using Macro Boxes.......................................................................................5 

    2.1  Generate macros automatically from macro projects................................5 

    2.2  Recreate macros.......................................................................................9 

    2.3  Exchange macros ...................................................................................12 

    2.4  Select macro objects...............................................................................14 

    2.5  Assign individual objects to a macro box ................................................16 

    2.6  Move handles..........................................................................................17 

    3  Creating Placeholder Objects....................................................................20 

    4  Extending Placeholder Objects .................................................................25 

    5  Editing Placeholder Objects ......................................................................28 

    6  Inserting Macros .........................................................................................30 

    6.1  Insert window macros and symbol macros .............................................30 

    6.2  Insert page macros .................................................................................32 

    7  Creating Macros..........................................................................................35 

    7.1 

    Create window macros and symbol macros ...........................................35 

    7.2  Create page macros ...............................................................................39 

    8  Creating Macros from DXF / DWG Files....................................................44 

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    3/46

      Macros

    EPLAN Training 3

    1 Creating Macro Projects

    You can use macro projects to manage and automatically create window macros.

    Precondition:

    You have created a basic project *.epb or project template *.ept .

    Project > Management

    1. In the Project management dialog you create a new project as describedunder Creating a Project from a Project Template or Creating a Project from aBasic Project.

    EPLAN opens the Project properties:  dialog.

    2. In the Properties tab select the "Settings" category.

    The "Type of project" setting will still be displayed.

  • 8/9/2019 0700 Working With Macros - Macros

    4/46

      Macros

    EPLAN Training 4

    3. Click here in the Value column on the associated field and select the "Macroproject" setting from the drop-down list.

    4. Click [OK].

    The new macro project is created and can be edited like a "normal" project.

    Notes:

    • Creating a new project is not the only way to create macro projects. You canalso first create a schematic project, prepare corresponding schematics cut-outs for the macros to be generated, and then convert to a macro project bychanging the project properties. To do this you only have to change the projectsetting "Type of project" to "Macro project" as described in step 3.

    • Macro projects do not contain cross-references, and connections are notgenerated.

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    5/46

      Macros

    EPLAN Training 5

    2 Using Macro Boxes

    Use the macro boxes to specify the outline and data for the macros to be generated.

    You can then use the EPLAN utilities to automatically generate macros from theseprepared macros.

    When writing window or symbol macros a macro box is also saved in the macro forthe specified cut-out. If you insert the macros on project pages, you will have theoption of inserting the macro box as well. To do this you have to select the Insertmacro boxes too check box (under Options > Settings > Projects > "Projectname" > Graphical editing > General). The inserted macro boxes are placed on acertain layer (EPLAN308 = Symbol graphic.Macro.Macro boxes). In layermanagement you can then specify the settings for this layer.

    Special program functions in the macro box enable you to retroactively change theobjects associated with an inserted macro and thus exchange variables for a macro,for example.

    Notes:

    • A macro box cannot be located within a macro box. The inner box is deletedwhen the macro is written.

    • There are no macro boxes in a page macro. The macro name, version, source,etc., are stored on all of the pages available. You can find this data in the page

    properties under the "Macro" category.

    • When compressing projects, there is a setting available for deleting all of theinserted macro boxes in a project. To do this, select the Macro boxes checkbox (in the Remove placed functions compression settings) and execute thesubsequent compression (see also Compress project).

    2.1 Generate macros automatically from macro projects

    You can use macro boxes to automatically generate macros in macro projects.

    Preconditions:

  • 8/9/2019 0700 Working With Macros - Macros

    6/46

      Macros

    EPLAN Training 6

    • You are in a macro project.

    • You have inserted objects on at least one page (e.g., schematics cut-outs,graphics, etc.), from which macros are to be automatically generated.

    1. Select Insert > Box / connection point / mounting panel > Macro box.

    2. Click with the mouse to determine the first corner of the box (request displayedin the status bar).

  • 8/9/2019 0700 Working With Macros - Macros

    7/46

      Macros

    EPLAN Training 7

    3. Use the mouse to drag the frame around the desired objects.

    4. Click once more with the mouse to determine the second corner of the box.

    5. Repeat steps 2-4 until all macro boxes are drawn.

    6. Finish this action via the Popup menu > Cancel action.

  • 8/9/2019 0700 Working With Macros - Macros

    8/46

      Macros

    EPLAN Training 8

    7. Double-click a macro box.

    EPLAN opens the Properties  dialog.

    8. In the Macro box tab specify the data for the macro to be generated. In orderto create a macro, you have to specify at least one macro name in the Name field.

    9. Click [OK] to confirm your entries and close the Properties dialog.

    10. Repeat steps 7-9 for all other macro boxes.

    11. Select the menu items Utilities > Generate macros > Automatically frommacro project.

    The areas identified above the macro boxes are written as window macros

    (*.ema) in specified directory (default is :

  • 8/9/2019 0700 Working With Macros - Macros

    9/46

  • 8/9/2019 0700 Working With Macros - Macros

    10/46

      Macros

    EPLAN Training 10

    2. Click the associated macro box.

  • 8/9/2019 0700 Working With Macros - Macros

    11/46

      Macros

    EPLAN Training 11

    3. Select the menu items Popup menu > Create macro.

    EPLAN opens the Save as dialog. The file name and variant of the macroare predefined.

    4. Click [OK] to confirm the overwrite.

    5. Confirm the prompt regarding overwriting the macro variant with [Yes].

  • 8/9/2019 0700 Working With Macros - Macros

    12/46

      Macros

    EPLAN Training 12

    2.3 Exchange macros

    Using a macro box inserted with the macro you have the option in the schematic ofreplacing an inserted macro with a different one–for example a different variant – tobe swapped.

    Preconditions:

    • Under Options > Settings > Projects > "Project name" > Graphical editing >General, you have defined that macro boxes must also be inserted.

    • You are in a schematic project and have inserted a macro.

    1. Click the desired macro box.

  • 8/9/2019 0700 Working With Macros - Macros

    13/46

      Macros

    EPLAN Training 13

    2. Select the menu items Popup menu > Exchange / rotate / update macro.

    EPLAN opens the Macro file selection dialog. If the selected macro is in apre-defined directory, then the file name is already predefined.

    3. Here you select another macro, variant, or nothing. In the latter case themacro is updated.

  • 8/9/2019 0700 Working With Macros - Macros

    14/46

      Macros

    EPLAN Training 14

    4. Click [Open].

    The macro inserted previously into the schematic is deleted and the newmacro is attached to the cursor.

    5. Position the new macro with a click at the desired position.

    Additional dialogs are possible afterwards, if you insert window macros and symbolmacros.

    2.4 Select macro objects

    If you would like to check whether objects belong to a macro (to which a macro box isassigned), there is a function that enables you to do this.

    Preconditions:

  • 8/9/2019 0700 Working With Macros - Macros

    15/46

      Macros

    EPLAN Training 15

    • Under Options > Settings > Projects > "Project name" > Graphical editing >General, you have defined that macro boxes must also be inserted.

    • You are in a schematic project and have inserted a macro.

    1. Click the desired macro box.

  • 8/9/2019 0700 Working With Macros - Macros

    16/46

      Macros

    EPLAN Training 16

    2. Select the menu items Popup menu > Select associated objects.

    All objects belonging to the macro are selected.

    You can then copy, move, or edit all of the macro objects in a table, for example.

    2.5 Assign individual objects to a macro box

    Normally, all objects located in a macro box belong to one macro. In a macro projectyou have the option of changing this macro object assignment.

    Preconditions:

    • You are in a macro project.

    • You have inserted one or more objects in a project page, from which a macro isto be automatically generated, and you have defined the plan of the macro tobe created, using a macro box.

    1. Select the objects that should belong to the macro. When doing this you canalso select objects that are not within the macro box, or exclude objects thatdo lie within the macro box.

  • 8/9/2019 0700 Working With Macros - Macros

    17/46

      Macros

    EPLAN Training 17

    2. Click the desired macro box and select the menu items Popup menu >Assign objects to macro box.

    The objects are assigned to the macro. You can check the assignment byselecting Popup menu > Select macro box for the respective macro box.

    By making this assignment the Individual object assignment check box will beselected in the Macro box tab in the properties dialog. If you want to remove theindividual object assignment, you have to deselect the corresponding check box. Theassociated objects in the macro box will then be back in the future macro.

    2.6 Move handles

    The handle is defined as the point where the cursor "sticks" when the macro isinserted. Normally, the macro hangs at the "top left" on the first insertion point. Usethe macro box to define the position of the handle.

    Preconditions:

  • 8/9/2019 0700 Working With Macros - Macros

    18/46

      Macros

    EPLAN Training 18

    • You are in a macro project.

    • You have inserted one or more objects in a project page, from which a macro isto be automatically generated, and you have defined the plan of the macro tobe created, using a macro box.

    1. Click the desired macro box.

    2. Select the menu items Popup menu > Move handle.

  • 8/9/2019 0700 Working With Macros - Macros

    19/46

      Macros

    EPLAN Training 19

    3. Move the cursor to the desired position and with a single mouse click definethe position where the contact point of the macro is to be located.

    When generating macros automatically from the macro project, the handleis also written to the macro with the macro box.

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    20/46

      Macros

    EPLAN Training 20

    3 Creating Placeholder Objects

    To insert placeholder objects, i.e., to define variables, proceed as follows:

    Precondition:

    You have opened a page in the graphical editor.

    Insert > Placeholder object

    1. Drag a frame around the objects for which you wish to define placeholders.

    2. In the Placeholder dialog, specify a name for the placeholder object in theName field.

    3. Select the Show preview check box if you would like to display the graphicalpreview of the selected elements.

    4. In the Assignment tab select the Category of elements (for example, devicesor revision data) to be displayed.

  • 8/9/2019 0700 Working With Macros - Macros

    21/46

  • 8/9/2019 0700 Working With Macros - Macros

    22/46

      Macros

    EPLAN Training 22

    8. In the Name new variable dialog specify the name of the new variable.EPLAN will automatically check whether the specified name is valid.

    The new variable is inserted as a new cell below the Variable columnheading.

    9. Select Popup menu > New value set.

    10. Specify the new value set in the newly created column.

    11. Repeat these steps for all additional variables and value sets to be generated.

  • 8/9/2019 0700 Working With Macros - Macros

    23/46

      Macros

    EPLAN Training 23

    12. Change back to the Assignment tab.

    13. In the Placeholder field, click the desired schematic objects with the rightmouse button in order to open the popup menu and select Popup menu >Select variable.

    14. In the subsequent dialog select the desired variable and click [OK].

    The variable is inserted into the selected column in the form.

    15. Repeat this variable assignment for all desired schematics objects.

    16. Click [OK].

    The new placeholder object is automatically placed on the left above thepreviously marked area.

    Note:

    • If you marked nothing  when you called the Insert > Placeholder object menu

    items, you first have to determine the desired object (for example via Edit >

  • 8/9/2019 0700 Working With Macros - Macros

    24/46

      Macros

    EPLAN Training 24

    Select > Area) (request displayed in the status bar).

    • If you have selected individual  schematic objects instead of an area, then youmust next define the position of the placeholder object with a mouse click(request displayed in the status bar).

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    25/46

      Macros

    EPLAN Training 25

    4 Extending Placeholder Objects

    In order to expand placeholder objects, select other objects that should also belong

    to the placeholder object.

    Precondition:

    The cursor is positioned on a placeholder.

    1. Select Popup menu > Select associated objects.

    The schematics elements that belong to the current placeholder object areselected.

  • 8/9/2019 0700 Working With Macros - Macros

    26/46

      Macros

    EPLAN Training 26

    2. Select other objects to be assigned by holding the [Ctrl] key.

  • 8/9/2019 0700 Working With Macros - Macros

    27/46

      Macros

    EPLAN Training 27

    3. Right-click the placeholder object and select Popup menu > Assign objectsto placeholder object.

    The selected objects are assigned to the placeholder object (new).

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    28/46

  • 8/9/2019 0700 Working With Macros - Macros

    29/46

      Macros

    EPLAN Training 29

    When leaving the cell and closing the dialog with [OK], every specified value isverified for validity for the properties in question. If an error occurs, a message willappear. This check only takes the data type into consideration. This check also takesplace after editing a placeholder assignment, but only when the correspondingvariable is not empty.

    Note:

    • It is not possible to block edit multiple  placeholder objects.

    • When compressing projects there is a compression setting available thatenables you to delete all placeholders from a project. To do this, select thePlaceholder object check box (in the Remove placed functions compression settings) and execute the subsequent compression.

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    30/46

      Macros

    EPLAN Training 30

    6 Inserting Macros

    Macros can be inserted on project pages as window or symbol macros. New project

    pages are created when inserting page macros.

    The macros are generally broken up when inserted, but it is still possible to changedata via the placeholder objects.

    6.1 Insert window macros and symbol macros

    Preconditions:

    • You have opened a project page.

    • Under Options > Settings > User > Display > General you have selected theOpen value set selection dialog for placeholders when inserting macros check box.

    1. Select the menu items Insert > Window macro or Insert > Symbol macro.Window macros can also be inserted via Popup menu > Insert macros.

    EPLAN opens the Select macro dialog.

    2. Select the desired macro. If a selected macro has variables, you can use theVariant drop-down list to specify which variant should be inserted.

  • 8/9/2019 0700 Working With Macros - Macros

    31/46

      Macros

    EPLAN Training 31

    3. Click [Open].

    The macro is attached to the cursor and can be positioned wherever youwant (one click).

    If value sets are available, select a suitable value set for the placeholder inthe Value set selection dialog. The inserted components contain the datafrom the value set.

    If there are device tags in the macro, and you have selected the Withprompt check box under Options > Settings > Projects > "Project name" >Devices > Numbering (online) in the On insertion of macros and copies group box, EPLAN opens the Insertion mode dialog.Specify here how the device tags in the inserted macro should be numbered.

    4. The macro is still attached to the cursor. Insert the macro again if you want.

    5. Press [Esc] to finish the action.

    Note:

    • When positioning the macro  with the mouse you can also use the additionalfollowing keys:[Y] + mouse movement: The macro can only be moved horizontally on itsoriginal position.[X] + mouse movement: The macro can only be moved vertically on its originalposition.[Y] + [X]: The macro is fixed to its original position and cannot be moved.

    • If there are variants  in a macro, you can select among the different variantswhen positioning the macro with the mouse. To do this press [Ctrl] and movethe cursor in a circle. The various macro variants are displayed.

    • If you return to inserting macros, the most recently selected macro is selected bydefault in the Select macro dialog.

    • Below the graphical preview of the dialog is a comments field . For window andsymbol macros, the source project from which the macro originates isdisplayed here along with the description, if available. For window macroscreated from DXF / DWG files this field only displays a note regarding their"source" ("DXF" for macros from DXF files; "DWG" for macros from DWG

  • 8/9/2019 0700 Working With Macros - Macros

    32/46

      Macros

    EPLAN Training 32

    files).

    • If the macro box should be inserted with the macro  when inserting window orsymbol macros, you have to select the Also insert macro boxes check box inthe settings (under Options > Settings > Projects > "Project name" >

    Graphical editing > General).

    6.2 Insert page macros

    1. Select the menu items Page > Page macro > Insert.

    EPLAN opens the Select macro dialog.

    2. Select the desired macro. When doing this you can select window (*.ema) orsymbol macro file types (*.ems) in the Files of type field in addition to pagemacros (*.emp).

  • 8/9/2019 0700 Working With Macros - Macros

    33/46

      Macros

    EPLAN Training 33

    3. Click [Open]. 

    EPLAN opens the Adjust page structure dialog.

    4. Here you specify the placement of the new pages in the page structure of yourproject.

    5. In the Adjust page structure dialog, click [OK]. The continuation of thisprocess is the same as for copying pages (see Adjusting the Page Structure).

    The pages are created or overwritten.

    Note:

    • If you return to inserting macros, the most recently selected macro is selected bydefault in the Select macro dialog.

    • Up to 12 pages are shown for page macros in the graphical preview of thisdialog. The source project from which the macro originated is displayed below

    this graphical display in a comments field  along with the description and thenumber of pages, if available.

    • The special property "Macro: Inserted by" is available in the page properties forinserting page macros (Category: "Macro"). When manually inserting a pagemacro, the user who inserted the macro is automatically entered here.

    Tip:

    You can insert macros using drag and drop, by dragging a selected file from the

  • 8/9/2019 0700 Working With Macros - Macros

    34/46

      Macros

    EPLAN Training 34

    Windows Explorer into the graphical editor or the page navigator of your project.

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    35/46

      Macros

    EPLAN Training 35

    7 Creating Macros

    In EPLAN you have the option of saving certain selected elements or areas of project

    pages as window or symbol macros. In addition, you can save one or more pages aspage macros if you have either selected them in the page navigator or opened themin the graphical editor. For all these actions, stored image files are saved along withthe macro.

    7.1 Create window macros and symbol macros

    Precondition:

    You are in graphical editing and have either selected the area on the page that

    contains the elements you want, or selected individual elements ([Ctrl] + mouseclick).

    1. Select the menu items Edit > Create window macro or Edit > Createsymbol macro. The menu item Create window macro is also available as anoption in the Popup menu after you have selected the elements on the page.

    EPLAN opens the Save as dialog. In the Directory field, the default targetdirectory is displayed.

  • 8/9/2019 0700 Working With Macros - Macros

    36/46

      Macros

    EPLAN Training 36

    2. In the File name field, enter the name of the macro. Click [...] to select anothername and / or another target directory.

    3. If necessary, select one or more variant designations for the macro in theVariant field. This is an interesting option if you want to create differentvariants for one macro. By default, one macro is saved as "variant A". You cancreate up to eight variants for one macro under the same file name.

    4. If desired, enter a description of the macro into the Description field. The textentered here is displayed in a comments field when inserting macros and

    simplifies the selection for you.

    5. If the page scale should be taken into consideration when inserting macros,you have to select the To page scale check box.

    6. Click the Handle button if you want to manually determine the point in themacro on which the cursor depends when inserting.

  • 8/9/2019 0700 Working With Macros - Macros

    37/46

      Macros

    EPLAN Training 37

    The Save as dialog will close briefly as it waits for a selection.

  • 8/9/2019 0700 Working With Macros - Macros

    38/46

      Macros

    EPLAN Training 38

    7. Move the cursor to the desired position and specify the new location of thehandle with a mouse click.

    The Save as dialog will open again.

    8. Click [OK].

    The macro is saved to the specified directory under the name .ema (window macros) or .ems (symbol macros). EPLAN checks whether avariant already exists under the specified name. If so, you will be requested todecide whether the old macro variant should be overwritten or not.

    Notes:

    • If nothing  is selected on the page, you can still select that area / individualelements after  selecting the menu item (request displayed in the status bar).

    • Angular and other macro variations are not created automatically, but must bemanually generated by you on the project pages, and then finally stored underthe same name with a different variant designation. If you have createddifferent variants of a macro, then you can choose between the variants when

  • 8/9/2019 0700 Working With Macros - Macros

    39/46

      Macros

    EPLAN Training 39

    inserting.

    • The macro box is saved in the window or symbol macro according to thespecified cut-out.

    7.2 Create page macros

    If the cursor is on a project page in the graphical editor, you can only save relatedpages in a page macro. On the other hand, you also can't write unrelated pages intoa page macro in the page navigator.

    Precondition:

    You have opened the page navigator.

  • 8/9/2019 0700 Working With Macros - Macros

    40/46

      Macros

    EPLAN Training 40

    1. Select the desired page(s) in the page navigator.

  • 8/9/2019 0700 Working With Macros - Macros

    41/46

      Macros

    EPLAN Training 41

    2. Select the menu items Page > Page macro > Create. Page macros can alsobe created via Popup menu > Create page macro.

    EPLAN opens the Save as dialog. In the Directory field, the default targetdirectory is displayed.

  • 8/9/2019 0700 Working With Macros - Macros

    42/46

      Macros

    EPLAN Training 42

    3. In the File name field, enter the name of the macro. Click [...] to select anothername and / or another target directory.

    4. If desired, enter a description of the macro into the Description field. The textentered here is displayed in a comments field when inserting macros andsimplifies the selection for you.

    5. If necessary, in the Number of pages field specify the number of pages to bewritten into the macro. The default in this field can only be changed if you havenot selected more than one page in the page navigator.

    6. Click [OK].

    The macro is saved in the specified directory under the name .emp and EPLAN checks whether a macro with the specified name already exists. Ifso, you will be requested to decide whether the old macro should beoverwritten by the new one or not.

  • 8/9/2019 0700 Working With Macros - Macros

    43/46

      Macros

    EPLAN Training 43

    Tip:

    You can create page macros with drag and drop, by dragging selected pages fromthe page navigator of your project into the Windows Explorer.

    This functionality is only available for certain module packages. Info

  • 8/9/2019 0700 Working With Macros - Macros

    44/46

      Macros

    EPLAN Training 44

    8 Creating Macros from DXF / DWG Files

    Utilities > Generate macros > From DXF / DWG files

    1. In the DXF / DWG files selection dialog select the desired DXF / DWG files.

    2. Click on [Open].

    3. In the DXF / DWG import dialog select the desired scheme and specify thetarget directory.

    4. Click [OK].

  • 8/9/2019 0700 Working With Macros - Macros

    45/46

      Macros

    EPLAN Training 45

    The selected files are saved in the specified directory (default is:\Macros\) as windowmacros .ema and can be inserted like "normal" windowmacros in EPLAN. When inserting the resulting window macros, a "DXF" isdisplayed for macros from DXF files and a "DWG" is displayed for macros

    from DWG files.

  • 8/9/2019 0700 Working With Macros - Macros

    46/46

      Macros