AutoSave

AutoSave

Anonymous
Not applicable
732 Views
10 Replies
Message 1 of 11

AutoSave

Anonymous
Not applicable
Hope someone can help

We are getting tired of Inventor Crashing, and loosing work. Not being an
expert in this field, Is it possible to write an autosave macro that runs
all the time and prompts you to save (or autosaves to a temp file) every 10
mins ?

Thanks in advance

Craig McKee
0 Likes
733 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
I would second that one.
Ole

"Craig McKee" wrote in message
news:4F67D6B0121C9B79F81158CA460C2A45@in.WebX.maYIadrTaRb...
> Hope someone can help
>
> We are getting tired of Inventor Crashing, and loosing work. Not being an
> expert in this field, Is it possible to write an autosave macro that runs
> all the time and prompts you to save (or autosaves to a temp file) every
10
> mins ?
>
> Thanks in advance
>
> Craig McKee
>
>
0 Likes
Message 3 of 11

Anonymous
Not applicable
Craig:
Paste this into a macro and run it. It will prompt to save every 600 seconds (10 min). -Murray

Dim LastTime As Single

Do
LastTime = Timer
Do
DoEvents
Loop Until Timer > (LastTime + 600)
On Error Resume Next
ThisApplication.ActiveDocument.Save
Loop
0 Likes
Message 4 of 11

Anonymous
Not applicable
For some reason the browser strips the line feeds... I don't know why. Everywhere you see a # in the following, replace it with a "return":

Dim LastTime As Single#

Do#
LastTime = Timer#
Do#
DoEvents#
Loop Until Timer > (LastTime + 600)#
On Error Resume Next#
ThisApplication.ActiveDocument.Save#
Loop#
0 Likes
Message 5 of 11

Anonymous
Not applicable
Just a suggestion for those that are better than I
at programming.

 

How about a progam that turns on transcripting.
Then another program that you can run after a crash that will automatically
rebuild  to where you where before the crash. It would be nice if the
program could run automatically every time Inventor starts and detect whether it
had crashed or not.

 

Word does this, and I had a video editing program
that did this as well. It crashed a lot but it never bothered me because I never
lost a single command.

 

just an idea,

enric ribas
0 Likes
Message 6 of 11

Anonymous
Not applicable
Does this or is there a way to get this run every
time you open a file?

 

Keith

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Craig:

Paste this into a macro and run it. It will prompt to save every 600
seconds (10 min). -Murray

Dim LastTime As Single

Do
    LastTime = Timer

    Do

        DoEvents

    Loop Until Timer > (LastTime + 600)

    On Error Resume Next

    ThisApplication.ActiveDocument.Save

Loop

0 Likes
Message 7 of 11

Anonymous
Not applicable
OK so you run this when you first open Inventor and
it will keep running all day right?  That's what it looks like to me. 
I can close files and open new ones and it still lists as running.  How
about having it start whenever you open Inventor?

 

Keith

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Does this or is there a way to get this run every
time you open a file?

 

Keith

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Craig:

Paste this into a macro and run it. It will prompt to save every 600
seconds (10 min). -Murray

Dim LastTime As Single

Do
    LastTime = Timer

    Do

        DoEvents

    Loop Until Timer > (LastTime + 600)

    On Error Resume Next

    ThisApplication.ActiveDocument.Save

Loop

0 Likes
Message 8 of 11

Anonymous
Not applicable
Keith,

Yes, it can be done if the code is incorporated into an add in. Someone who has the full version of Visual Basic would need to do that for you, as I don't have it.
0 Likes
Message 9 of 11

Anonymous
Not applicable
I just got it of recently so I could
start learning this stuff.  I'll read up in the help section about making
an add-in.  I'm pretty sure I saw a wole section in there about
it.  Thanks for the nice code.

 

Just wondering...If this is so easy to do, then why
wouldn't Autodesk put in an add-in for this?

 

Keith

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Keith,

Yes, it can be done if the code is incorporated into an add in. Someone who
has the full version of Visual Basic would need to do that for you, as I don't
have it.

0 Likes
Message 10 of 11

Anonymous
Not applicable
One more thing...This does automatically save over
your original part right?  This might be the one downside because you don't
get prompted for the save. 

 

 

How about some code that saves it to a different
name?  Am I asking to much of this stuff?  I guess that's how most
programs work though.  Just thinking in terms of AutoCAD. 
Thanks.

 

Keith

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I just got it of recently so I could
start learning this stuff.  I'll read up in the help section about making
an add-in.  I'm pretty sure I saw a wole section in there about
it.  Thanks for the nice code.

 

Just wondering...If this is so easy to do, then
why wouldn't Autodesk put in an add-in for this?

 

Keith

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Keith,

Yes, it can be done if the code is incorporated into an add in. Someone
who has the full version of Visual Basic would need to do that for you, as I
don't have it.

0 Likes
Message 11 of 11

Anonymous
Not applicable
Keith:

It's not a difficult matter to save the part under a different name. Instead of using the .Save method, use the .SaveAs method, and give it an "autosave" filename. If you were really ambitious, you could append a timestamp to the filename and store as many old versions as you want, saved in a series of files such as "autosave_915am", "autosave_925am", etc. The versioning system within inventor accomplishes the same thing though...

I suspect that Autodesk did not include an autosave because of complexities with multiusers, and multiple instances of parts being open in assemblies.

Murray
0 Likes