AVEVA P&ID Macros Manager
- Last UpdatedJan 30, 2025
- 3 minute read
The AVEVA P&ID Macros Manager dialog can be used to manage macros delivered with AVEVA P&ID.
A prerequisite to installing AVEVA macros manager is to upgrade customer projects using the project wizard, or to manually install the distributed files at the project root folder:
-
Acad.lsp: hosts basic routines required for AVEVA P&ID initialization.
-
Acaddoc.lsp: hosts the configuration for the AVEVA P&ID Macros Manager dialog and other macros.
-
Acad.dvb: contains the implementation of all macros distributed with AVEVA P&ID.
Note:
Use the procedure to run VBA macros distributed with AVEVA P&ID using native AutoCAD.
-
Copy the Acad.lsp, Acaddoc.lsp and Acad.dvb files into the target folder. Alternatively, copy the files to the windows document folder.
-
Launch AutoCAD and add the path location of Acad.dvb, Acad.lsp and Acaddoc.lsp files to the existing AutoCAD environment using Options dialog.

-
Select the Load Application option in the Applications Group of the Manage tab.

The Load/Unload Applications dialog is displayed.

-
Click Startup Suite, the Startup Suite dialog is displayed.

-
To add the files to the Startup Suite dialog, click the Add button and select them using the Add File to Startup Suite dialog. Once the macros are loaded, the AVEVA P&ID Macros Manager, and all the distributed VBA macros become available.
-
To load the AVEVA P&ID Macros Manager, select the VBA Manager option from the Add-ins tab. Alternatively, use the command: AVVRUNMACROS.

The AVEVA P&ID Macros Manager dialog is displayed.

The AVEVA P&ID Macros Manager dialog is designed to run single or multiple macros by selecting one or more macros from the tree view.
Hover the mouse over a highlighted macro to display tooltip information.

The tree view groups the macros under user defined nodes which are configured in the Lisp Commands use with VBA macros section of the acaddoc.lsp file. For example:
;;;-------------------------------------------;
;;;Lisp Commands use with VBA macros.
;;;-------------------------------------------;
;;;-------------------------------------------;
;;; Description Macro: Create batch drawing operation running commands define by user at a script file.
;;; Group:Management
;;;-------------------------------------------;
(defun c: AVVMAC_CRBATCH
()
(princ
)
VBA macros initiated with commands must be registered at the ThisDrawing object event handler module which is included with the VBA project solution.

At the event handler implementation:
Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
At the selected case structure, add a case instance for the command using a flag design to be evaluated at the event handler:
Private Sub AcadDocument_EndLisp()
Case "(C:AVVMAC_CRBATCH)"
CreateBatchFile = True
At the event handler implementation:
Private Sub AcadDocument_EndLisp()
At the selected case structure, add a case instance for the command entering the method to be executed by the macro:
If CreateBatchFile Then
BatchGenerator.show vbModeless
CreateBatchFile = False
End If