Using LISP c:ace_projwide_script to run a project wide script

Using LISP c:ace_projwide_script to run a project wide script

Damian_Lee3WBMU
Explorer Explorer
455 Views
4 Replies
Message 1 of 5

Using LISP c:ace_projwide_script to run a project wide script

Damian_Lee3WBMU
Explorer
Explorer

I have tried to use the flowing lisp file to run a script for each drawing in the project:

 

(defun c:ALLDWGS ()
(c:ace_projwide_scipt nil ALL_LINKS)
)

 

The script file "ALL_LINKS" is already loaded and runs if I call it from command line. The script for that is as follows:

 

(defun c:ALL_LINKS ()
(COMMAND "DATALINKUPDATE" "U" "K")
(COMMAND "ZOOM" "E")
)

 

Could these commands be incorporated into the "c:ace_projwide_scipt" somehow?

 

Any help would be greatly appreciated as I am new to this.

 

Regards

 

Damian

0 Likes
456 Views
4 Replies
Replies (4)
Message 2 of 5

Thomas.CoxTFXY8
Advocate
Advocate

 

This is already built in AutoCAD Electrical, see "run script file" below

 

ThomasCoxTFXY8_0-1681223661759.png

 

0 Likes
Message 3 of 5

Damian_Lee3WBMU
Explorer
Explorer

Thank you for the reply, but I want to use LISP so I can add it to a custom button on the menu.

0 Likes
Message 4 of 5

james.mcmillanNYR6A
Collaborator
Collaborator

The script file you are trying to run, all_links, is a lisp file, not a script. You could write this lisp as a script, or write a script file to run this lisp

Message 5 of 5

james_moore
Advocate
Advocate

Save your code as a script file, instead of a LISP.
If you structure it correctly, it will process as if you were entering the LISP manually from the command line:

(defun c:ALL_LINKS () (COMMAND "DATALINKUPDATE" "U" "K")(COMMAND "ZOOM" "E"))

(c:ALL_LINKS)

 

... this saved as filename.scr should work just fine, and be usable from the Run Script option in the Project-Wide Utilities to apply to the drawings you select from your project.

0 Likes