Download T-FLEX CAD User Manual. Fundamentals. 2D Design

Transcript
Fundamentals. Two-Dimensional Design
M AC RO S
T-FLEX CAD design process often involves performing various calculations. Some tasks can be handled by
using the variable editor. However, the variable editor offers only limited calculation capabilities. For
example, it does not support use of loops. This limits the scope of tasks that can be handled directly within
T-FLEX CAD.
Another design issue that users face is much time spent for performing repetitive tasks. For example, it might
be necessary to create a set of layers in one drawing that is similar to a set of layers in another drawing, and
distribute the objects of the former drawing on the newly created layers. Such a task requires certain
concentration, especially considering that the number of layers in the document may be large.
Such issues can be easily addressed with the help of «macros».
Here is another example: in the course of
creating three-dimensional assembly models,
the user may need to create slots and holes at the
fastening locations for assembling parts, and
insert fastener fragments with certain
parameters. Use of macro helps automate this
process, reducing the number of actions. One
can write a macros, running which would let the
user simply select an LCS in the scene, after
which the system would automatically create the
holes in the part, pick up the appropriate
fastener set with certain parameters and insert it
into the assembly. As this example
demonstrates, a large number of actions that the
user would have done manually are replaced by
just two steps: launching a macros and selecting
an LCS.
Those are just a few examples where macros can be used.
Working with Macros
Macro in T-FLEX CAD is a program written in one of the programming languages, using T-FLEX CAD
API functions. For more details on using API functions, refer to the section Help “T-FLEX CAD API
Manual”.
A macro is executed as a single command, that is, by launching a macro once, the whole set of actions will
be performed that are contained within the macro (calculations, handling of T-FLEX CAD objects,
displaying results etc.).
Macros are stored within the T-FLEX CAD *.grb files. At the same time, the *.grb file that contains macros
is itself a Project. Each Project may contain an unlimited number of macros.
732