Working with User-Defined Macro Functions - Intergraph Smart Instrumentation - Help

Intergraph Smart Instrumentation Help

Language
English
Product
Intergraph Smart Instrumentation
Search by Category
Help
Smart Instrumentation Version
13.1

You can perform string manipulation on retrieved data by assigning user-defined functions to the macro that retrieved the data. You create user-defined macro functions on the basis of Smart Instrumentation standard macro functions.

The macro function affects the display formatting of the data which the macro returns after generation. For example, you can specify a user-defined function that removes all the spaces in the retrieved values and displays the remaining characters as upper case.

You can apply functions to macros directly on the CAD drawing or in the database.

Priority for Macro Functions

The order of priority for macro functions is as follows:

  1. CAD drawing level — A macro function that you specify at the CAD drawing level has the highest priority for execution. In this case, you type the macro function abbreviation directly in the generated drawing in your CAD application. At this level, you can define one function per macro.

  2. Database level — The next highest level of priority for execution is when you define a function with a specific macro.

  3. Database level — The lowest priority for execution is given when you define a default function. To learn how to set a macro function as default, see Create a User-Defined Macro Function.

Macro Function Syntax

If you want to apply the highest macro function priority do the data retrieval, you can associate a function with a macro directly on the CAD drawing block using the function abbreviation. The function abbreviation is a string with maximum of 4 characters, the first of which must be a letter. The general structure of a macro with a function is:

[Macro_name.F1]

where F1 is the macro function abbreviation.

The general format of a wiring macro that includes a user- defined macro function is:

[Macro_name.x.y.F1]

Example

The following is an example of a macro with a function:

W_CLR.1.1.RS

In this example, the macro name is W_CLR.1.1 and the macro function is RS (remove spaces).

  • Your user defined macro names must be unique, do not copy or use existing macro names as this results in the macros failing to display correctly.

  • Use a period (.) as the separator to separate the individual macro segments.

  • The software uses the macro function parameters.

  • When using a macro function at the database level, you should not define that macro function on the drawing block or in the generated drawing.  For the software to recognize macro functions defined at the database level, on the Preferences dialog, under Loop Drawings > General, select the Use macro functions check box. If you set a macro function as default, the software automatically adds the abbreviation of the function to the macro in the actual CAD drawings, and you do not need to add it with every block and macro. If you do not set a macro function as default, you need to add the macro function abbreviation manually on the drawing.

  • Macros in a CAD application, that you want to solve with a general signal in Smart Instrumentation, must have the general signal name (as defined in the Smart Instrumentation Local Signal dialog box) added as a prefix to the CAD application macro. For example, for the CAD macro PNL_NAME.1.4, to be recognized by Smart Instrumentation and solved with the general signal called GENERALIST1, you add the general signal name to the CAD macro as a prefix in the CAD application: GENERALIST1.PNL_NAME.1.4.

See Also

Customizing Macro Definitions