Although it is possible to make transformations on a symbol as well as on the individual objects that compose it, the symbol always maintains its own basic structure. For example, a symbol consisting simply of a four-sided polygon can be resized or rotated, but it will always remain a polygon of four Sides. With dynamic symbols, instead, You can drag a hook to make the symbol change its structure; The four-sided symbol that describes a square can take the form of a Pentagon or an Octagon.
Unlike multiform symbols, which allow you to choose from a number of predefined shapes drawn when defining the symbol, dynamic symbols can dynamically calculate their shape using a macro procedure linked to the symbol.
To create dynamic objects
In order to attribute dynamic functionality to an object you must associate a macro procedure with it. The name of the macro procedure must be specified in the object's internal ObjRun attribute. Dynamic functionality can only be assigned to the following types of objects: Shape, Group, Symbol, Sheet.
If the macro name is complete with extension (.clxjs) it is considered to be the name of a file containing the macro code. The file is searched in the following order: as an attached file within the current Job, as a file present in the current Job folder, as an attached file within the library file from which the symbol comes and finally as a file in the folders library files.
If the macro name has no extension, it is initially searched for in the documents of the current job. This is useful when developing the macro.
The macro procedure
The procedure that defines the dynamic functionality of an object can be implemented using the script language.
A script, in order to define dynamic functionality, must define a function that handles the following events:
OnDynamicGetInfo
OnDynamicGetHooks
OnDynamicMoveHook
OnDynamicGetMenu
OnDynamicRunMenu
OnDynamicClick
Using Dynamic Objects
When a dynamic object is selected, it shows its dynamic hooks represented by yellow squares.
Tip: |
---|
If the complex object (group or symbol) includes more than one dynamic object, only the hooks related to the first dynamic object are shown. To display the hooks of the other dynamic objects press the TAB key repeatedly. |
For information on possible actions
Select the object and bring the mouse cursor over the dynamic hooks to display in the status bar some information about the action connected to each hook.
To activate the dynamic action
Select the object and to activate the action connected with a hook, click on the hook and drag the mouse. Some actions may have different effects if the keys: SHIFT, CTRL and ALT are also pressed while dragging the hook.
To display the actions menu
If the macro procedure provides for it, a menu can be displayed with the list of dynamic actions available for the selected object. Select the object and right-click to display the menu. If available, the dynamic actions menu is the last one at the bottom.