macro create

A macro is a single command that you create to execute a series of Adams View commands. To create a macro, you give Adams View the list of commands you want executed, as well as the new command (i.e., the macro) that will execute them.

Format:

 
macro create
macro_name =
macro name
user_entered_command =
command representing the macro
commands_to_be_executed =
list of commands to be executed
wrap_in_undo =
yes/no
help_file =
help file path
help_string =
help text
create_panel =
yes/no
security_code =
alpha-numeric code to run a macro

Example:

 
macro create &
   macro_name = .TEST_MACRO &
   user_entered_command = "TESTMAC" &
   commands_to_be_executed = &
"!$parts:T=part:C=0", &
"!$analysis:T=analysis:D=Last_Run", &
"!END_OF_PARAMETERS", &
"!", &
"!---set the default analysis", &
"defaults analysis analysis_name = $analysis", &
"",&
"!---loop through part list", &
"for var=the_part obj=$parts", &
" defaults model part_name=(the_part)", &
" file spread_sheet write &", &
" file_name = (DB_DEFAULT(SYSTEM_DEFAULTS,\"PART\").name) &", &
" result_set_name = ((DB_DEFAULT(SYSTEM_DEFAULTS,\"PART\").name)//\"_XFORM\")", &
"end", &
"", &
"!---clean-up", &
"variable delete variable_name=(eval(db_children($_self,\"variable\")))" &
!
  wrap_in_undo = No &
  help_string = "This test macro can export part XFORM results." &
  create_panel = No
!
 

Description:

 
Parameter
Value Type
Description
macro_name
String
Specifies the name of the new macro.
user_entered_command
String
Specifies the command string to be entered by the user to execute the macro.
commands_to_be_ executed
String
Specifies the list of Adams View commands to be executed.
wrap_in_undo
Yes/No
Specifies whether or not to the entire macro can be undone with a single undo command.
help_file
String
Specifies the text that is to be used as the command or topic string when getting help on a macro.
help_string
String
Specifies the text that is to be used as the command or topic string when getting help on a macro.
create_panel
Yes/No
Allows the user to specify if a panel is to be created for the specified macro.
security_code
 
 

Extended Definition:

1. Adams View will not allow you to have two macros with the same full name, so you must provide a unique name. You must separate multiple macro names by commas.
2. The user_entered_command is a string with list of keywords separated by blanks. The keywords can match existing keywords, but the final command defined must be unique.
For example: user_entered_command = "force my_force create"
If this parameter is not entered, the name of the macro will become the new command.
3. You can specify the Adams View commands that are to be executed when the macro is used with the commands_to_be_executed parameter on the macro read and macro modify commands, or from a file on the macro read command. Adams View does not check your entries in this field for correct syntax when you create the macro, only when the macro is executed the syntax errors will be notified. You enter these commands as quoted strings separated by commas. You can have quotes inside a string by proceeding them with a backslash "\". You can indicate parameters to associate with the macro be placing a dollar sign '$' followed by the name of the parameter you want anywhere in the commands.
4. The help that is obtained by help_file is the same as you would get if you supplied the help string to the command: help command_or_topic=. You must specify the entire file name, there is no default extension. The search path facility is used to find the specified file.
5. If there are no parameters in the macro, no panel will be created. The name of the macro panel will be macro_ appended with the macro name. For example, if the name of macro being created or modified is MAC1, the panel will be named macro_MAC1.

Cautions:

1. If the macro is very large turning the wrap_in_undo option to yes may decrease the speed of it's execution.

Tips:

1. You may identify a macro by typing its name. If a macro is available by default, you may identify it by entering its name only. If it is not, you must enter its full name. If you type a "?", Adams View will list the macros available by default.