Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

MACRO runs a script (or "macro") in scripting enabled software like AutoCAD, Rhinoceros, MatLab, Word, Excel, etc.

Syntax

MACRO(ProgramName$, (Script)FileName$, Macro$, OutputFile$/LocationLabel$, [ContinueCaption$])

Arguments

  • ProgramName$ is ProgramName$ is a string expression containing the name of the software to be used. Present programs tested:
    • MSWord (also see WINWORD$() function)
    • MSEXCEL (also see EXCEL#() function)
    • MSVISIO
    • Rhinoceros (use Rhino3, Rhino4)
    • AutoCAD (use AutoCAD16, AutoCAD17)
    • MatLab
  • (Script)FileName$ is a string expression containing the name of (drawing) file or the file in which the macro script has to be saved.
  • Macro$ is a string expression containing the macro script, either VBA or any other supported script.
  • OutputFile$ is a String expression containing the name of an output file created by the script, if any. This output file can e.g. contain a set of values computed by the script in the software used.
  • ContinueCaption$ is an optional string argument containing the caption of the modal continue button that is shown after posting the script to the connected software. In the case of a CAD system or drawing program, this allows you to make changes to the result generated by the script before allowing the system to continue the session.

...

  1. To create a script for the function, usually you can record a series of actions with something like a macro recorder or discribed syntax of the program you want te script to be used in. After creating the script you copy it as TEXTITEM$() into the data slot of a parameter and you use the TEMPLATE$() function to fill the script with your parameters to integrate and use it dynamically into your knowledge base.
  2. If OutputFile$="NullString", the MACRO() function will return a string containing "ProgramName$ script completed".
  3. In Visio, Word and Excel the posted macro is immediately removed from the document after it has been executed.
  4. In addition to the programs mentioned Qnowledge is alway willing to investigate implementation of the same functionality for programs not yet mentioned above

...