The Smart Fragment mechanism allows us to develop parametric library elements whose insertion scenario is described in the program stored directly in the file of the given library element or in the external module (DLL). Settings of T-FLEX CAD macros and also the program interface (Open API) allow us to describe settings in such a way that upon insertion of the file as a fragment or upon its editing/deletion the user-specified macro will be executed.
The macro can contain code realizing the required logic of the user’s interface on insertion/editing/deletion of the given fragment. For example, the adaptive model «Small groove» was developed that has a set of external variables and adaptive parameter – circular edge which must be substituted upon insertion of the fragment.
The «Groove.grb» file contains the macro InsertGroove which performs selection of exclusively circular edges located at the intersection of the external cylinder and the planar face. Upon insertion of the given groove from the library the macro is launched automatically. Instead of regular command of insertion of a 3D fragment with the full interface, the simplest command is working at this moment that allows us to select the edges satisfying the given condition and to change the values of external variables of the inserted fragment.
The result of insertion of the fragment by this scenario is the small groove on the shaft.
This mechanism allows users-programmers to create the most convenient scenarios of fragments insertion in various applied fields.