failed to save
failed to save
(OP)
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
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






RE: failed to save
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] pc2](https://www.tipmaster.com/images/pc2.gif)
FAQ731-376: Eng-Tips.com Forum Policieswww.scottjbaugh.com
RE: failed to save
Heckler![[americanflag] americanflag](https://www.tipmaster.com/images/americanflag.gif)
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.
RE: failed to save
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
www.industrialdesignhaus.com
What did you dream? It's all right--we told you what to dream.
--Pink Floyd, Welcome to the Machine
RE: failed to save
RE: failed to save
RE: failed to save
I think I had to run through and rebuild all the configs to solve the problem.
RE: failed to save
RE: failed to save
Heckler![[americanflag] americanflag](https://www.tipmaster.com/images/americanflag.gif)
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.
RE: failed to save
Just my $.02.
Jeff Mirisola, CSWP
Certified DriveWorks AE
http://designsmarter.typepad.com/jeffs_blog
Dell M90, Core2 Duo
4GB RAM
Nvidia 3500M
RE: failed to save
Ed Danzer
www.danzcoinc.com
www.dehyds.com
RE: failed to save
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
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
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
RE: failed to save
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?
RE: failed to save
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
RE: failed to save
RE: failed to save
Then you can chech the box which correponds to the library MS Scripting Runtime.
SW2007 SP5
Worksatation HP wx4300 2GB
NVidia Quadro FX 3450
RE: failed to save
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