script issue after upgrade

script issue after upgrade

gcsjlewis
Collaborator Collaborator
955 Views
10 Replies
Message 1 of 11

script issue after upgrade

gcsjlewis
Collaborator
Collaborator

I just recently upgraded to Autocad Electrical 2019, previously using 2012.  When i run a script command through an autolisp routine, it does nothing other than repeat a bunch of "command:" on the command line.  Here's a look at my command line.  (There's about 25 "Command:" thats repeated.)

 

Enter script file name <C:\Users\jlewis.GI\Documents\Drawing1.scr>: t:/acad_autolisps/scripts/Complete_project - Jason.scr
Command:
Command: *Cancel*
Command:
Command:
Command: . . .

 

This script is supposed to open up each dwg in the project and run a bunch of commands.  This has always worked in 2012, but right after updating, it's not in 2019.  Other cad users are still using 2012, and it still works in 2012.  (i am just running 2019 to make sure we have no issues before we do a whole dept. upgrade.)

 

At this point if i open up my autolisp and copy the following to the command line:

 

(command "_.script" product_rev_att)

 

Where product_rev_att = t:/acad_autolisps/scripts/Complete_project - Jason.scr

 

it works, but why is it not executing through the lisp?

 

Any ideas?

 

Thanks,

 

 

0 Likes
956 Views
10 Replies
Replies (10)
Message 2 of 11

Kent1Cooper
Consultant
Consultant

Do you have the SDI System Variable [= Single-Drawing Interface] set differently in the 2012 setups than you do in 2019?  By default, it would be off [i.e. SDI=0, allowing Multiple-Drawing Interface] in any new installation.  As I understand it [but I don't ever work in Single-Drawing mode], AutoLisp routines can't start in one drawing and continue in another unless  you're in Single-Drawing mode [SDI=1], so maybe that's how you have the 2012 installations set.  Or might it be built into the Script to change that, do its thing, and change it back?  If so, it ought to also work in 2019, so the problem would be somewhere else.

 

Can you post the AutoLisp routine that calls it, and the Script content itself?

Kent Cooper, AIA
0 Likes
Message 3 of 11

cadffm
Consultant
Consultant

Set CMDECHO to 1

or add some (princ "\n1.\n) (princ "\n2.\n) ... (princ "\n25.\n)

in your script to see where the Problem is [F2]

 

Without your Script and without to know the Autocad react, how should we know where the problem is -

 

 

Sebastian

0 Likes
Message 4 of 11

gcsjlewis
Collaborator
Collaborator

both set to 0.  FYI, I use the blackboard to store variables to carry over from sheet to sheet.

0 Likes
Message 5 of 11

gcsjlewis
Collaborator
Collaborator

I wasn't sure if there was some stupid glitch that was caught, that required a service pack update, or maybe syntax has to be changed.

0 Likes
Message 6 of 11

gcsjlewis
Collaborator
Collaborator

as for posting the script/lisp, we are talking thousands of lines.  It basically reads excel, grabs a bunch of info, creates a project and distributes that info throughout the project, it would take way too much of your time to look through it.  I just answered CADffm's reply, i wasn't sure if there was a change in the script syntax that i wasn't sure of.  Or if maybe a common lisp command became obsolete.  I just found it weird that its not working, but in 2012, for the past 5 years it has with no issue.  When i first tried to run it, i got a message (something along the lines) unknown program/ publisher, and do i want to run it anyway, it gave me a couple of options as alway, never, etc.   I said always, and i added the script file location to the trusted file paths in the option dialog.

0 Likes
Message 7 of 11

gcsjlewis
Collaborator
Collaborator

cmdecho is set to 1

 

I added your lines to my lisp, right before the (command "_.script" product_rev_att) ,here is a copy of what i now see:

 

1.
2.
25.
_.script
Enter script file name <C:\Users\jlewis.GI\Documents\Drawing1.scr>: t:/acad_autolisps/scripts/Complete_project - Jason.scr
Command:
Command: *Cancel*
Command:
Command:
Command:
Command:
Command:

0 Likes
Message 8 of 11

cadffm
Consultant
Consultant

"I added your lines to my lisp, right before the (command "_.script" product_rev_att) "

 

No, we want to see where the Script stuck (and we don't know about the content of your script :rolleyes:)

 

So:

 

(princ "\nStart Script")

(command "_.script" product_rev_att)

(princ "\nEnd Script")

 

 

And inside the Script..

 

(alert "\nScript line FIRST")

your script lines..

one more

and one more

(alert "\nScript line Last")

 

Without to know the content of Lisp and SCR, i am out - Sorry.

 

Sebastian

0 Likes
Message 9 of 11

gcsjlewis
Collaborator
Collaborator

I've tried this, but i did it again, and here is the entire commandline.  Starting with the lisp i created, that will create a script file, and the execute the script.  In bold is when the script runs.....the alerts i put in at the beginning and the end of the script file did pop up.

Command: newproj
Total cells to cycle through 56
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Total cells to cycle through 112
Analog Input cells to cycle through 8
Analog Output cells to cycle through: 0
Discrete Input cells to cycle through: 32
Discrete Output cells to cycle through: 16
Thermocouple cells to cycle through 0
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
Checking files for any marked in-use/read-only . . .
((O2 0 I10100 1769-IF8 1 1 4-20mA X ) (O10 0 I10200 1769-IQ16 1 2 X ) (O26 0 I10300 1769-IQ16 1 3 X ) (O42 0 O10400 1769-OB16 1 4 X ))
GCS TitleBlock;;<<~~~princ command i put in to make sure it got to this point in the program
Start Script_.script
Enter script file name <C:\Users\jlewis.GI\Documents\Drawing2.scr>: t:/acad_autolisps/scripts/Complete_project - Jason.scr
Command:
End Script
Command: *Cancel*
Command:
Command:
Command:
Command:
Command:
Command:

0 Likes
Message 10 of 11

gcsjlewis
Collaborator
Collaborator

Here's the script that was created....

 

open
"T:\Acad_Autolisps\Testing\Test_project\111-11-01.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-02.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-03.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-04.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-05.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-06.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-07.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-08.dwg"
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-09.dwg"
(c:120vac)
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-10.dwg"
(c:120vac2)
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-11.dwg"
(c:120to24)
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-12.dwg"
(c:24vdc2)
audit
Y
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-13.dwg"
(c:insert_plc_card)
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-14.dwg"
(c:insert_plc_card)
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-15.dwg"
(c:insert_plc_card)
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-16.dwg"
(c:insert_plc_card)
_.qsave
_.close
open
"T:\Acad_Autolisps\Testing\Test_project\111-11-17.dwg"
(c:insert_plc_card)
_.qsave
_.close
open
T:\Acad_Autolisps\Testing\Test_project\111-11-04.dwg
(c:panel)
audit
Y
_.qsave
_.close
open
T:\Acad_Autolisps\Testing\Test_project\111-11-05.dwg
(c:dinrail)
audit
Y
_.qsave
_.close
open
T:\Acad_Autolisps\Testing\Test_project\111-11-06.dwg
(c:subpanel)
audit
Y
_.qsave
_.close
open
T:\Acad_Autolisps\Testing\Test_project\111-11-07.dwg
(c:terminal_layout)
audit
Y
_.qsave
_.close
open
T:\Acad_Autolisps\Testing\Test_project\111-11-08.dwg
(c:terminal_layout)
audit
Y
_.qsave
_.close

0 Likes
Message 11 of 11

gcsjlewis
Collaborator
Collaborator

still trying different things, but one thing that can work, once the lisp is run, which is supposed to start the script file, and nothing happens, on the command line i type resume, and it runs fine.  I don't know if that would give you any ideas.

0 Likes