T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design T-FLEX Parametric CAD. Fundamentals. 2D Design

scp.s.scptuj.mb.edus.si
from scp.s.scptuj.mb.edus.si More from this publisher
30.07.2013 Views

Macros A special folder «/Program/Macros/» is provided in the T-FLEX CAD installation directory. Macros of all Projects (*.grb files) located in this folder will be displayed in a special “Macros” window of T-FLEX CAD. «Macros» Window The «Macros» window can be called by one of the following means: Keyboard Textual Menu Icon «Customize|Windows|Macros» The main purpose of this window is launching macros for execution. This window displays not only macros projects from the folder «/Program/Macros/», but also the macros of the current open file. Storing a macro within a particular *.grb file does not imply that this macro can only be used in the given document. You can launch any of the macros displayed in that window. For example, the project «Copy layers.grb» is located in the folder “/Program/Macros/”. The «CopyLayers» macro, which copies layers from one document into another, can be arranged as follows: the user creates a new document or opens an already existing one. Upon launching the macro, the «file open» dialog appears, offering to select the file from which the layers are to be copied. After that, similar layers will be created in the current open file. The user can create one's own macros library by placing the files from Projects with macros to the folder»/Program/Macros/». To launch a macro for execution, select it in the «Macros» window and double-click . The icon preceding the macro marks its current state: –A selected macro. –A running macro. Creating Macros, Macro Editor A special Macro editor is provided for creating macros. Macro editor is a macro development environment integrated in T-FLEX, which contains the full set of editing and debugging tools. Writing a macro does not require any application or programming environment. All tools are packed within the Macro editor. The macro editor can be opened by the command: Keyboard Textual Menu Icon «Tools|Macro Editor» The macro editor contains a set of tools that makes development and management of macros easier. The figure below depicts the main tools of the macro editor. 741

Fundamentals. Two-Dimensional Design «Projects» Window The window can be accessed via the text menu of the macro editor: View|Projects. The T-FLEX CAD file appears in the macro editor as a Project. Each Project can include a set of Modules, Forms and References. A so-called modular programming approach is used when writing macros in T-FLEX CAD environment. Modular programming is the way of structuring a program as a union of small independent blocks, called modules, whose structure and behavior are governed by certain rules. Module is a separately compilable program unit which includes various components (types, constants, variables, namespaces, classes, procedures and functions). From the program source perspective, a macro is a procedure. Procedure is a part of a program devised for performing a certain specific task. Form is the dialog box of a macro, within which control elements can be placed (such as text, buttons, text input boxes, radio groups etc.), used for operating the macro. More details on working with this window will be revealed in the topic «Creating macros with screen forms» of this chapter. 742

Macros<br />

A special folder «/Program/Macros/» is provided in the T-<strong>FLEX</strong> <strong>CAD</strong> installation directory. Macros<br />

of all Projects (*.grb files) located in this folder will be displayed in a special “Macros” window of T-<strong>FLEX</strong><br />

<strong>CAD</strong>.<br />

«Macros» Window<br />

The «Macros» window can be called by one of the following means:<br />

Keyboard Textual Menu Icon<br />

«Customize|Windows|Macros»<br />

The main purpose of this window is launching macros for execution.<br />

This window displays not only macros projects from the folder «/Program/Macros/»,<br />

but also the macros of the current open file.<br />

Storing a macro within a particular *.grb file does not imply that this macro can only<br />

be used in the given document. You can launch any of the macros displayed in that<br />

window. For example, the project «Copy layers.grb» is located in the folder<br />

“/Program/Macros/”. The «CopyLayers» macro, which copies layers from one<br />

document into another, can be arranged as follows: the user creates a new document or opens an already<br />

existing one. Upon launching the macro, the «file open» dialog appears, offering to select the file from which<br />

the layers are to be copied. After that, similar layers will be created in the current open file.<br />

The user can create one's own macros library by placing the files from Projects with macros to the<br />

folder»/Program/Macros/».<br />

To launch a macro for execution, select it in the «Macros» window and double-click .<br />

The icon preceding the macro marks its current state:<br />

–A selected macro.<br />

–A running macro.<br />

Creating Macros, Macro Editor<br />

A special Macro editor is provided for creating macros.<br />

Macro editor is a macro development environment integrated in T-<strong>FLEX</strong>, which contains the full set of<br />

editing and debugging tools. Writing a macro does not require any application or programming environment.<br />

All tools are packed within the Macro editor.<br />

The macro editor can be opened by the command:<br />

Keyboard Textual Menu Icon<br />

«Tools|Macro Editor»<br />

The macro editor contains a set of tools that makes development and management of macros easier. The<br />

figure below depicts the main tools of the macro editor.<br />

741

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!