Automatically saving a drawing when exiting it when SDI=0

Automatically saving a drawing when exiting it when SDI=0

Anonymous
Not applicable
837 Views
9 Replies
Message 1 of 10

Automatically saving a drawing when exiting it when SDI=0

Anonymous
Not applicable

Hello All,

I have an issue that I am working on with Autodesk in which I cannot run in the SDI=1 mode. Because I cannot run in that mode I end up with many open and unsaved drawings. My fear, which has been realized form time to time, is that my computer or ACADE will crash and I will lose all the work done on all the open drawings.

 

I found a Lisp routine that saves and closes all but the current drawing. CLSAVE.LSP is the routine. I do not have an author for this routine but thank you to whomever wrote this.

 

I put that Lisp routine (c:cas) into my ACADDOC.LSP (which runs whenever a drawing is opened) and now whenever I open a new drawing it runs this routine so I end up with only 1 drawing open at a time.

 

There are plenty of threads about using the ACADDOC.LSP but if needed I can share how that works.

 

Attached is the CLSAVE.LSP Lisp routine.

 

Hope this may help someone!!!

 

Thanks

 

Dennis

0 Likes
838 Views
9 Replies
Replies (9)
Message 2 of 10

Jon.Dean
Alumni
Alumni

Thanks for sharing your experiences with us and providing a workaround for saving drawings not being worked on.

Jon.



Jon Dean

0 Likes
Message 3 of 10

Kent1Cooper
Consultant
Consultant

This could also be done without custom code, using the SAVEALL and QQUIT Express Tools, possibly only the latter depending on whether you want to be prompted about saving drawings that have been edited.

Kent Cooper, AIA
0 Likes
Message 4 of 10

Anonymous
Not applicable

Without the custom code i would have to click to save which is what i was trying to avoid.

The prompt of asking to saving would be a good thing.

I will look to see if I can write in the prompt to save into the code.

 

Thanks

 

Dennis

0 Likes
Message 5 of 10

Anonymous
Not applicable

I have editted the LSP routine so it prompts asking to save, not to save, or exit with save.

I have attached both the LSP routines.

 

Thanks

Dennis

0 Likes
Message 6 of 10

BlackBox_
Advisor
Advisor

Like you, at least some years ago, I worked in SDI == 1 back when using Land Desktop... I'm still curious about the 'cannot work in SDI == 1' bit; may I inquire as to why not?

 

Cheers

 

 


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

0 Likes
Message 7 of 10

Anonymous
Not applicable

I cannot work in SDI=1 do to the fact that whenever I have a command that changes drawings and returns to the original drawing it causes ACADE to lose all commands when the original page is reopened.

I cannot see the cursor when on the drawing, I cannot click on any icons, I cannot type in the command line. I cannot even close ACADE once this happens. CTRL/ALT/DELETE is the only way out at this point.

 

Thanks

 

Dennis

0 Likes
Message 8 of 10

BlackBox_
Advisor
Advisor

@Anonymous wrote:

I cannot work in SDI=1 do to the fact that whenever I have a command that changes drawings and returns to the original drawing it causes ACADE to lose all commands when the original page is reopened.

I cannot see the cursor when on the drawing, I cannot click on any icons, I cannot type in the command line. I cannot even close ACADE once this happens. CTRL/ALT/DELETE is the only way out at this point.


Okay, thanks for clarifying.

 

So you actually can/do work in SDI (not MDI) - you're just suffering the benefit of attempting to code in LISP, which is a Document level language.

 

Meaning, the code must be loaded into each-and-every-single Drawing, regardless of SDI/MDI, *and* any information you want to 'communicate' from one drawing to another must be first written to an external location (i.e., file, registry, etc.), with few Blackboard/Namespace exceptions when in MDI.

 

You either have to step up into an Application level language, such as C# .NET, or modify your code logic to suite the limitations you've elected.

 

Cheers


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

0 Likes
Message 9 of 10

Anonymous
Not applicable

OK first off this/you are talking WAY over my head!!!

 

Working in the SDI mode works fine most of the time. If I am in the SDI mode and forget to turn it off before allowing ACADE to update a drawing other than the one I working on it corrupts ACADE and I have to shut it down and restart it. LOL forgetting is common for me, I have a good memory it just a short one!!!!!!

 

I do have the ability to work in SDI mode(SDI=1) but i have to actually work in MDI (SDI=0) unless I want my ACADE to stop working correctly when i preform certain functions.

 

The ACADDOC.LSP is an ACADE customizable option which loads each time a drawing is open.

The LISP I attached works OK for what I want to do....save drawings upon exiting.

My issue is ACADE crashes on a regular basis (3-4 times a week) and if I have multiple drawings open I lose the work done on them.

 

0 Likes
Message 10 of 10

BlackBox_
Advisor
Advisor

@Anonymous wrote:

OK first off this/you are talking WAY over my head!!!

 

Working in the SDI mode works fine most of the time. If I am in the SDI mode and forget to turn it off before allowing ACADE to update a drawing other than the one I working on it corrupts ACADE and I have to shut it down and restart it. LOL forgetting is common for me, I have a good memory it just a short one!!!!!!

 

I do have the ability to work in SDI mode(SDI=1) but i have to actually work in MDI (SDI=0) unless I want my ACADE to stop working correctly when i preform certain functions.

 

The ACADDOC.LSP is an ACADE customizable option which loads each time a drawing is open.

The LISP I attached works OK for what I want to do....save drawings upon exiting.

My issue is ACADE crashes on a regular basis (3-4 times a week) and if I have multiple drawings open I lose the work done on them.

 


Haha, too funny!

 

I work with Infrstructure Design Suite, mostly Civil 3D, and not ACADE... And I know not the nature of your work 'between drawings', but I can offer that certain 'vertical-only' Objects do not play nice when copied back and forth, which is where C3D implements something called LandXML to properly export/import said data.

 

*IF* presumably ACADE operates similarly, then perhaps the ACADE development team can work towards a resolution, with your continued feedback here, and as part of Beta/Customer Counsil? *not sure*

 

As for the over the head stuff, put simply, LISP (AutoLISP and Visual LISP) is just one of the many APIs AutoCAD offers. Each programming language (LISP, VBA, .NET, ObjectARX [aka C++ for AutoCAD], etc.) has its trade-offs, as discussed in this series of great Devblog articles:

 

http://adndevblog.typepad.com/autocad/2012/07/the-right-tools-for-the-job-autocad-part-1.html

 

 

 

Good luck!


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

0 Likes