AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issues with project wide utility and a simple script file

28 REPLIES 28
SOLVED
Reply
Message 1 of 29
afutterer
1849 Views, 28 Replies

Issues with project wide utility and a simple script file

I am trying to get a simple script file to run project wide in acade 2010.  The idea is to be able to convert the page setup of every file to monochrome so when I do a file->publish to pdf they will all be in black and white and I can save them as a single file.  It will also plot in the background so I can continue working.    Here is the script file;

 

;;Resets all Page Set-Up information for drawings to allow file->publish->pdf while maintaining monochrome
;;advantage of this is that we can plot them all to one file without having to combine the individual
;;pdf files seperately.
;;RUN AS PROJECT WIDE UTILITY FROM PROJECT TOOL BAR
;;BY AKF 2/8/2011

-plot
no
model
Canon iR3225 PCL5e.pc3
no
yes
no

 

     If I do a publich->plot project from the project manager it will open each drawing and save them all as individual files which I then have to combine, but I am given the option to select a plot style and the drawings come out fine.  However, this method also means that I can not work on my machine at all while acad is plotting.

     Here is the text I get when I try to run the script;

 

WD_PRJ_RUN_CUR_DWG_OEM -plot
no
model
Canon iR3225 PCL5e.pc3
no
yes
no
wd_scr_qsave3

 

ACAD then freezes up and I have to escape the program.  I am new to scripting and would greatly appreciate any information anyone can give me...

     What does wd_scr_qsave3 mean anyways?

 

anthony

28 REPLIES 28
Message 2 of 29
Icemanau
in reply to: afutterer

It's an ACADE dialog box asking to qsave the current drawing before changing to the first drawing in the plot list. It only comes up on the first drawing and might make it a tad hard to program into a script file.

 

Regards Brad



Icemanau (NNTP handle: Brad Coleman
AutoCAD Electrical User and IT Hardware Support

Message 3 of 29
afutterer
in reply to: afutterer

How can I work around this, or somehow acknowledge it or bypass it?

Message 4 of 29
Icemanau
in reply to: afutterer

Save your active dwg andmake sure the first dwg in the plot list is the active dwg on screen.

 

If that doesn't work, I don't have a clue.

 

Regards Brad



Icemanau (NNTP handle: Brad Coleman
AutoCAD Electrical User and IT Hardware Support

Message 5 of 29
afutterer
in reply to: Icemanau

still does not work.  There is a new development though.  If I hit Enter a few times while it is hung up, it will say "deleted 83 blocks" and then not move on to the next drawing.

     I thought this was what project wide utilities was for, why is it not working?

Message 6 of 29
PatMurnen_Adsk
in reply to: afutterer

To run the script are you using the AutoCAD Electrical Project-Wide Utility and then checking the "Run command script file" option? If that is the case this function saves each drawing before it goes on to the next if anything in the drawing changed. The wd_scr_qsave3 does not use any dialgos and simply saves the drawing.

 

One thing to try and determine the issue is to run the script on the active drawing. Are there any problems with it? Does it return to the command line cleanly. Sometimes it can be as simple as too many blank lines in a script which can be interpreted as an Enter repeating a command. Or not enough to complete the command.

 

If you attach the script file I can try and determine what is happening. What version of AcadE are you using?



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 7 of 29
afutterer
in reply to: PatMurnen_Adsk

Pat,

     The issue was blank lines at the end of the program.  Thanks for the tip.

Message 8 of 29
PatMurnen_Adsk
in reply to: afutterer

Glad that was it.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 9 of 29
mc5fan
in reply to: PatMurnen_Adsk

I have a similar problem. The script runs the 1st dwg and then stops. If I left click in the drawing area it will advance to the next file. a left click is required to advance. I have manipulated the "space" and/or "return" entries at the end of the scripts. Nothing helps.

Lee M.
Message 10 of 29
PatMurnen_Adsk
in reply to: mc5fan

Hi mc5fan,

 

If you can attach the script file, I will take a look at it. What version of AutoCAD Electrical are you using?

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 11 of 29
mc5fan
in reply to: PatMurnen_Adsk

LEE MALASPINA has shared a OneDrive file with you. To view it, click the link below.



[https://r1.res.office365.com/owa/prem/images/dc-generic_20.png]

02 Zoom Extents.scr




Autocad electrical 2018. Any script file that I choose does the same thing. These all run except as the batch run.
Lee M.
Message 12 of 29
PatMurnen_Adsk
in reply to: mc5fan

Lee, the link led me to a PNG file not a SCR file. Is your SDI system variable set to 0? 

 

-Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 13 of 29

Lee,

 

Lee, the link led me to a PNG file not a SCR file. Can you try again or attach it to a reply?

 

Also, is your AutoCAD SDI system variable set to 0? This might affect scripts so I want to make sure what your setting is.

 

-Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 14 of 29
mc5fan
in reply to: PatMurnen_Adsk

No, it is a script. My e-mail program is doing that!



ZOOM
EXTENTS
QSAVE



Lee
Lee M.
Message 15 of 29
PatMurnen_Adsk
in reply to: mc5fan

Lee,

 

I have seen some people say that when replying by email, attachments don't work properly. Can you click the link in the email to open a browser to the discussion thread, reply, and scroll down and select Choose File under Attachments. You probably need to zip the file since some file types are stripped out.

 

I did create a script with those 3 commands in it and it worked fine in my sample project. I've attached my file, test.scr.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 16 of 29
stefan.stamate
in reply to: mc5fan

I always have to be sure that I have the last drawing from the project open when I am running the script using the "Project Wide Utilities". 

Message 17 of 29

I didn't have my last drawing in the project open, but I did have a drawing from the project open. Any update on this? Did my test script work or are you still having issues?

 

Regards,

Pat 



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 18 of 29
mc5fan
in reply to: PatMurnen_Adsk

No, it does not work regardless. I will assume ACADE 2018 has bugs. I got a new version of AUTOSCRIPT 3.4 that works in ACAD. As long as AUTOSCRIPT works, I am not worried about it. Thanks for your assistance.

 

 

 

Lee M.

Lee M.
Message 19 of 29
PatMurnen_Adsk
in reply to: mc5fan

Lee,

 

Glad the Autoscript is working so you can move forward. I would be happy to look at the script you wanted to use in AutoCAD Electrical to confirm if AutoCAD Electrical has a bug in this area. This way I can get it logged. You can send the .scr file to me directly at pat.murnen@autodesk.com if you want.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 20 of 29
mc5fan
in reply to: PatMurnen_Adsk

NONE of the established good scripts work. AutoScript does the job and has a nice user interface. Shame on Autodesk.

 

 

Lee M.

Lee M.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost