Close all drawings and open a single dwg

Close all drawings and open a single dwg

gccdaemon
Collaborator Collaborator
1,873 Views
5 Replies
Message 1 of 6

Close all drawings and open a single dwg

gccdaemon
Collaborator
Collaborator

Don't have time for coding. Can someone write me a routine that closes all open drawings and opens a file called temp.dwg?

 

I'm trying to add this to a template update routine and can't have people in a "new file" because it locks the acad.dwt from being deleted.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
0 Likes
Accepted solutions (1)
1,874 Views
5 Replies
Replies (5)
Message 2 of 6

paullimapa
Mentor
Mentor

I know you can use the CLOSEALL command to close all open drawings.  It'll even prompt the user to save the drawing if required.

But once all drawings are closed, you wont' be able to execute a command to open a new drawing.  Perhaps someone else can jump in here with an idea.

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 6

gccdaemon
Collaborator
Collaborator

Perhaps it would be easier programmatically to open the drawing first and close the other drawings open in the background.

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 4 of 6

paullimapa
Mentor
Mentor
Accepted solution

Great idea.  So if you have AutoCAD 2016 and up, you can use the new command called CLOSEALLOTHER

If you have older AutoCAD versions, then you can use the attached lisp I found:

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/close-all-drawings-except-current-dr...

 

So you open the dwg first, then you either enter the CLOSEALLOTHER command or load the lisp code and enter CAS

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 6

gccdaemon
Collaborator
Collaborator

We have some on 15 and some on 18, so this will do what I need. Thank you sir!

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
0 Likes
Message 6 of 6

paullimapa
Mentor
Mentor

glad to have been able to help....cheers!!

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes