Versions Compared

Key

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

...

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

Arguments

  • 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 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.

...

either creates a drawing with name Diagram$ and posts the macro CompIDMacro$ to Visio, or simply posts the macro CompMacro$ to Visio if Visio already has a drawing with name Diagram$open. In this case, in the macro an index of the newly created component is saved in the file VisioMacro.epo (on the current default solution/project directory). CompMacro$ is a VBA macro that is typically created with the TEMPLATE$() function.
As soon as the macro is executed, the modal continue button will appear with the message "Move object to final location" which gives the user the opportunity to move the new object manually to a desired location. If ContinueCaption$ is omitted in the MACRO() function, the session continues without further notice.

...

saves the Rhino script CompMacro$ in the file MacroName$ and passes the file to Rhino for execution. CompMacro$ is a VBA macro that is typically created with the TEMPLATE$() function. In this case, the macro not only places the component in the drawing but also calculates the volume of the newly created component and saves it in the file RhinoMacro.epo (on the current default solution/project directory). Since the ContinueCaption$ is omitted in this MACRO() function, the session continues without further notice.

...

BEFORE executing the macro, the modal continue button will appear with the message "Select location for inluding item..." which gives the user the opportunity to manually select a location in the document on which to perform the macro (typically the inclusion of a picture or dedicated piece of text. If ContinueCaption$ is omitted in the MACRO() function or has the value "NullString", the macro will be performed on the document on the location at which LocationLabel$ occurrs, after which the session continues without further notice.

...

either creates a spreadsheet with name ExcelSheet$ and posts the macro ExcelMacro$ to Excel or simply posts the macro ExcelMacro$ to Excel if a sheet with name ExcelSheet$ is already open. ExcelMacro$ is a VBA macro that is typically created with the TEMPLATE$() function (you can create a macro. 
AFTER executing the macro, the modal continue button will appear with the message "Press OK to Continue" which gives the user to check the result of whatever macro has been run. If ContinueCaption$ is omitted in the MACRO() function or has the value "NullString", the macro will be performed on the sheet, after which the session continues without further notice.

...