[Autocad Scripts] Project-wide script hangs on first drawing

[Autocad Scripts] Project-wide script hangs on first drawing

brybarczyk
Explorer Explorer
537 Views
7 Replies
Message 1 of 8

[Autocad Scripts] Project-wide script hangs on first drawing

brybarczyk
Explorer
Explorer

I am trying to run a script on a project in Autocad Electrical 2025. The script loads an .LSP file. The .LSP file imports wire layers from a .DFT file into the drawing. It works normally when doing an active drawing, but when I try to run the script project-wide, it hangs. I've pasted the whole script text below. 

;script to load all the MCS wire layers into the current drawing
;cmdecho 1
(load "C:\\_MCS_ENG_Vault\\ACADE_Shared\\AeData\\MCS-UPD-CLAY.LSP")
MCS-UPD-CLAY
MCS-STANDARD
E

When I try to run the script through the Project-Wide Utilities button, it prints out the results on the console more than once and it never ends up running the command. Sometimes it crashes. See Photo

brybarczyk_0-1739914352154.png

 

I want to get this figured out because it would be a huge help to my team and myself. 

0 Likes
538 Views
7 Replies
Replies (7)
Message 2 of 8

james.mcmillanNYR6A
Collaborator
Collaborator

do you have enough enters (new line) in your script to finish the command sequence allowing the utility to continue to the next drawing?

0 Likes
Message 3 of 8

brybarczyk
Explorer
Explorer

Yes. After the user inputs 'E' and presses enter, the script should finish because that's the last enter of the script

0 Likes
Message 4 of 8

james.mcmillanNYR6A
Collaborator
Collaborator

share your script file, you will need to change the file extension to .txt to attach

0 Likes
Message 5 of 8

brybarczyk
Explorer
Explorer

The MCS-UPD-CLAY.LSP file was converted to .txt along with the .scr file

0 Likes
Message 6 of 8

james.mcmillanNYR6A
Collaborator
Collaborator

It's quite hard to test this due to the files involved, does it work if you put another line here? this is the equivalent of pressing enter again

 

jamesmcmillanNYR6A_0-1739972323966.png

 

 

0 Likes
Message 7 of 8

brybarczyk
Explorer
Explorer

It works fine when I select the Active Drawing, but not when I select Project-Wide. I've added more and more <new line> (I added up to 8 new lines at one point) but I still get the same result.

0 Likes
Message 8 of 8

james.mcmillanNYR6A
Collaborator
Collaborator

sure, adding more lines won't help, this is the equivalent of pressing enter in AutoCAD, which assuming the command has finished will just try to repeat the last command

 

is it stuck somewhere internally to your lisp? (princ) at the end might help, looks like it might be trying to repeat the selection of DFT name

0 Likes