User Tools

Site Tools


example:macro

This is an old revision of the document!


Macros

ACS-SASSI generates a large amount of data that tends to be processed using repetitive tasks.

A Macro in ACS-SASSI is a specially formatted *.pre file that has variables. Variables are defiend by a positive integer number that is encapsulated with dollar signs (example $1$, $2$ … ,$10293$). Macros are loaded into the Submodler with the use of the LOADMACRO command. The user can then call the macro by using the MACRO Command. When the user calls the macro command the variables are replaced by the arguments given to the instruction. The integer in the variable is directly related to the argument number in the command.

Example(s)

Basic Example

 
* Node-Macro.pre A Simple example Macro
N,1,$1$,$2$,$3$ 
* MacroTest Pre will be equivalent to N,1,13.52,15,100.25
LoadMacro,Node,.\Node-Macro.pre
Macro,Node,13.52,15,100.25

Graphing Example

* SRSS-macro.pre
* Load 3 lines SRSS data and output result to a file 
* and capture image of all the lines on the graph
READSPEC,$1$,1,1
READSPEC,$2$,1,2
READSPEC,$3$,1,3
SRSS,4,1,2,3
WRITESPEC,$4$,4 
* Capture images.
SPECPLOT,1,2,3,4
CAPTUREPLOT,$4$.png
CLOSEPLOT
* SRSS_folder.pre
* Create SRSS files for all nodes in the model
LOADMACRO,SRSS,SRSS-macro.pre
MACRO,SRSS,Node1x.rs,Node1y.rs,Node1z.rs,Node1srss.rs
MACRO,SRSS,Node2x.rs,Node2y.rs,Node2z.rs,Node2srss.rs
MACRO,SRSS,Node3x.rs,Node3y.rs,Node3z.rs,Node3srss.rs
MACRO,SRSS,Node4x.rs,Node4y.rs,Node4z.rs,Node4srss.rs
                        ...
MACRO,SRSS,Node5214x.rs,Node5214y.rs,Node5214z.rs,Node5214srss.rs
example/macro.1370983383.txt.gz · Last modified: 2013/06/11 16:43 by phil