Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

failed to save 5

Status
Not open for further replies.

hotiron

Mechanical
Nov 16, 2007
79
Hi all,
I get a "Failed to save" note periodically when I save and close files. I'll have to pick "No" to any note recommending me to save, in order to close the file. Can happen with all types of files. It appears the file has been saved when I re-open however(?). Any thoughts?
SW2007 sp1.1
 
Replies continue below

Recommended for you

Working over the network can cause this. A lot people have seen this, but no one can record it with SW RX. If you can capture this send it into your VAR. Another time I have seen this was due to a corrupted file. your file or files could be corrupting. This happens more often when working over a network.

Best thing to do is turn your backup copies on and save more often. If you are working over a network work locally.

Regards,

Scott Baugh, CSWP [pc2]
"If it's not broke, Don't fix it!"
faq731-376
 
I get this error when I have too many programs running in the background that gobble up the system resources. Internet Explorer is the cause of it most of the time.

Heckler [americanflag]
Sr. Mechanical Engineer
SWx 2007 SP 4.0 & Pro/E 2001
o
_`\(,_
(_)/ (_)

This post contains no political overtones or undertones for that matter and in no way represents the poster's political agenda.
 
I don't get the message, but will often see things as the same result of what Heckler. For instance, I'll get a message like "Failed to find sufficient resources to perform operation" (or whatever) when I try to select Tools > Options. This means SW has glazed over and needs to be shut down/restarted. On these occasions, sometimes SW isn't really saving my files anymore either and I have to go through everything I just did to double-check.

However, my system has been acting up generally recently, so I'm guessing this has something to do with memory management in Windows--since I see this behavior in SW only when I'm using up lots of RAM (have 3GB). I've also not heard of anyone else having this problem with SW, so my case seems a bit unusual.

So--are you working over a network?



Jeff Mowry
What did you dream? It's all right--we told you what to dream.
--Pink Floyd, Welcome to the Machine
 
I have all files local. I also installed 2Gb memory a while back. All things equal, it seems to be only in SW2007(my experience).
 
Is it an assembly? I recently had an issue like this and the problem was linked to a part with configurations.
I think I had to run through and rebuild all the configs to solve the problem.
 
Yes the problem is configuration driven. The best way to explain it is this. You did enough editing that it became too deep for solidworks to rebuild and save. In order to get solidworks to save you need to go into your other configurations and rebuild and try to save them. You might even have to open an assembly or assemblies that are in your main assembly and rebuild all the configurations and save them then go back to your main and do the same. All are designers have had this problem and this technique has always worked. Good Luck.
 
This is also a windows resource issue. This happened to me while editing a part drawing and an assembly drawing with no configurations.

Heckler [americanflag]
Sr. Mechanical Engineer
SWx 2007 SP 4.0 & Pro/E 2001
o
_`\(,_
(_)/ (_)

This post contains no political overtones or undertones for that matter and in no way represents the poster's political agenda.
 
When I get this I think another program has started the problem. Excel can be a major contributor if a cell is being edited. Sometimes it can even affect the video. I have done file save as command to see if it actually writes a file of similar size then do a restart of Windows. I agree that it can help to not have too many configurations in several layer deep subassemblies or use the same subassembly in several places with different configurations.

Ed Danzer
 
We have this problem since long time ago (2007 SP0).

We are all working over a gigabit network.

The problem occurs on different workstations and in the same 2-3 days. Then we haven't the problem for 15 days.

Sometimes the problem occurs even if SW is accessing to only local files.

But, in majority of cases, the problem is corrected by an macro that I've written, which force-rebuild all configurations in the current file :
Code:
Option Explicit
Dim swApp As SldWorks.SldWorks


Sub main()

    Dim model As ModelDoc2
    Dim configurations As Variant
    Dim conf As Variant
    Dim forceRb As Integer
    Dim forceRebuildParam As Boolean
    Dim currentConfiguration As String
    
    Set swApp = Application.SldWorks
    Set model = swApp.ActiveDoc
    
    If model.GetType = swDocASSEMBLY Then
        ' Ask for rebuilding recursivly or not
        forceRb = MsgBox("Rebuild top level assembly only ?", vbYesNoCancel)
        
        If forceRb = vbYes Then
            forceRebuildParam = True
        ElseIf forceRb = vbNo Then
            forceRebuildParam = False
        Else
            End
        End If
    ElseIf model.GetType = swDocPART Then
        ' The current document is a part -> only top level
        forceRebuildParam = False
    Else
        ' the current document is a Drawing, rebuild doc and quit
        model.ForceRebuild3 False
        End
    End If
    
    ' save the active configuration
    currentConfiguration = model.GetActiveConfiguration().Name
    ' get the configurations name
    configurations = model.GetConfigurationNames
    
    ' Rebuild all configuration without the active
    For Each conf In configurations
        If StrComp(conf, currentConfiguration, vbTextCompare) <> 0 Then
            model.ShowConfiguration2 conf
            model.ForceRebuild3 forceRebuildParam
        End If
    Next
    
    ' Active the configuration which was actived and rebuild doc
    model.ShowConfiguration2 currentConfiguration
    model.ForceRebuild3 forceRebuildParam
    
    MsgBox "All configuration was rebuilt"

End Sub

Usually, we need to execute the macro on the part suposed to be the source of the problem.

Another macro which can be useful, is a macro which recursively force-rebuild all components
Code:
'forces rebuild of top assembly and all subassemblies
Option Explicit

Dim swApp As SldWorks.SldWorks
Dim model As SldWorks.ModelDoc2
Dim swModel3D As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swSheet As SldWorks.Sheet
Dim swView As SldWorks.View
Dim swActiveView As SldWorks.View
Dim bRet As Boolean
Dim nErrors As Long


Sub main()
    Dim nomFichier As String
    
    Set swApp = Application.SldWorks
    Set model = swApp.ActiveDoc
    
    ' termine execution if not file is openned
    If model Is Nothing Then
       End
    End If
        
    ' if the current file is a drawing, get external references to rebuild thems
    If model.GetType = swDocDRAWING Then
        Dim extFilesPath As Variant
        Dim extFile As Variant
        

        Set swDraw = model
        Set swSheet = swDraw.GetCurrentSheet
        
        Set swView = swDraw.GetFirstView
        Set swView = swView.GetNextView
        
        Set extFilesPath = New Dictionary
        
        ' get external references. Filter list in oder to get only once reference by file
        While Not swView Is Nothing
            If Not extFilesPath.Exists(swView.GetReferencedModelName) Then
                extFilesPath.Add swView.GetReferencedModelName, swView.GetReferencedModelName
            End If
            
            Set swView = swView.GetNextView
        Wend

    
        For Each extFile In extFilesPath
            Debug.Print extFile
            swApp.ActivateDoc2 extFile, True, nErrors
            
            Set swModel3D = swApp.ActiveDoc
            swModel3D.ForceRebuild3 (False)
            'swModel3D.Save
            swApp.CloseDoc extFile
        Next
        
        
        swApp.ActivateDoc2 model.GetTitle, True, nErrors
        Set model = swApp.ActiveDoc
        model.ForceRebuild3 (False)
    
    Else
        model.ForceRebuild3 (False)
    End If
End Sub

This macro contains some lines in oder to fix an other problem which occurs on drawings (when the view wasn't synchronised with the model -> bug fixed on saved files with 2007 SP3).

Hope those will be useful ...

SW2007 SP5
Worksatation HP wx4300 2GB
NVidia Quadro FX 3450
 
Florent
I got the code to run for the forced rebuild of all configurations(thanks) but got a " compile error - User defined type not defined" message for the forced rebuild all components. The offending line appears to be "Set extFiles Path = New Dictionary" We are on SW2007 sp1.1, is that an issue?
 
Ok, sorry to forgot that.

In fact, I use Dictionary (by reflex) because it's more efficient that simple array.

You only need to add an reference (Tools/References) which named "Microsoft Scripting Runtime"

This will make macro able to use this library, then Dictionary object.




SW2007 SP5
Worksatation HP wx4300 2GB
NVidia Quadro FX 3450
 
Where do I add this MS Scripting Runtime reference?
 
As I said in my previous post, when you are in the MS Visual Basic Editor, you click on the menu Tools/References.

Then you can chech the box which correponds to the library MS Scripting Runtime.



SW2007 SP5
Worksatation HP wx4300 2GB
NVidia Quadro FX 3450
 
Florent,

Your code to "force rebuild all configs" is something I will get a lot of use from. Thanks! If anyone is curious, it works for me on SW2006 SP5.1.

Joe
SW Office 2006 SP5.1
P4 3.0Ghz 1GB
ATI FireGL X1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top