Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Lost file


Bill Cronkhite
 Share

Recommended Posts

but the descriptor is scramble

but doesn't access through MC

~~~~~~~~~~~~~~

wHAT DO YOU MEAN ?If you looked in hex.editor and saw that file header and data are bad there is no way to heal the file ,if your file size less then 300 kb it may be empty .

But if you lost descriptor this is a small thing .

You mayhaps not lost it at all .

Reboot ,load your mc file one more time and you may

see it .

What does it means no access .

You crashing while loading it .

If so try to merge it to the empty file or

import it as get from library together with geometry

Link to comment
Share on other sites

If you can not load you file (means you are getting crash ),deselect restore entire NCi on file /get .

If you ll manage to load it this way ,run ramsaver .

And after that proceed to regen operations one by one .

You`ll find what the problematic operation is

 

BR

HTH

Link to comment
Share on other sites

Salahuddin,

File size is still the same in details, and using properties, I can see the preview,so it's still there. Auto save was what caused the problem. Started an autosave and got the error message fatal error, closing. After I re started Mc, the file will open, but the geometry is gone.

 

 

Iskander,

THe crash happened during a save. The descriptor seems to be the only thing affected. File size is still the same as before. When I open it in Mc, it opens, but no geometry. Just like a new file.

Link to comment
Share on other sites

Bill, I would stongly suggest some sort of backup routine. I've had some really bad crashes and lost dozens of hours of work on a few occasions..

 

This VB Script creates a .zip file using the MC file name, then adds the current MC9 file with a date/time stamp added to the end. It's sort of an incremental backup, keeping all dated mc9 files in the same zipped file.

 

code:

'//   Description:   Makes a time/date stamped backup of the current MC file to the folder specified.

'// Use 7Zip 4.32 Command Line (7Za.exe) to compress the backup file. Once the file

'// has been backed up, the dated MC9 file is deleted.

'// You can get the command line interface at: www.7-zip.org

'//

'// Comments: Ensure the correct path and arguments for the compression

'// you wish to use are entered below. You need to use the truncated name for

'// long path names that contain spaces when calling 7za.exe.

'// View the 7zip help file for command line options.

 

 

' -----------------

' | Constants |

' ------------------------------------------------------------------------

Public Const DEF_CENTERED = " "

Public Const DEF_ERRLOG = "C:CustomersZip Backup Error.log" ' Path and file for error log

'Public Const strZipPath = "C:Progra~1WinZipwzzip.exe -m -ex" ' Optional path and options for compression with Winzip.

 

Public Const strZipPath = "C:PROGRA~17-Zip7za.exe a -tzip" 'Path and options for compression

Public Const DEF_BACKUP_DIR = "C:Roling CustomersZipped Backups" ' Backup folder

 

Dim strBackupPath ' compiled path and file name with time stamp

Dim strOriginalPath ' original path of current file name

Dim strFilePath '

Dim FSO

Dim strYear

Dim strMonth

Dim strDay

Dim strHour

Dim strMin

Dim C

Dim strName

 

C = Chr(34) ' holder for " (double quote)

 

Call Main()

 

Sub Main()

Call RepaintScreen (True)

On Error Resume Next

' -- Check to make sure backup folder is valid

Set FSO = CreateObject("Scripting.FileSystemObject")

If FSO.FolderExists(DEF_BACKUP_DIR) Then

' -- Make sure we have a drawing to save

If Not IsDrawing Then

ShowString "No current drawing" & DEF_CENTERED

' -- Bail

Exit Sub

End If

' -- Store current drawing's name

strOriginalPath = GetCurrentFileName

' -- Format a time and date stamp and strip illegal chars

strYear = Replace(FormatDateTime(Date, vbShortDate), "/", "-")

strHour = Replace(FormatDateTime(Time, vbShortTime), ":", "")

' -- Build path for the MC9 file name with date/time stamp added

strBackupPath = AddBackSlash(DEF_BACKUP_DIR) & FSO.GetBaseName(strOriginalPath) & "_" & strYear & "_" & strHour & "." & FSO.GetExtensionName(strOriginalPath)

' -- Build path for .ZIP file, (MC9 file name without date/time stamp, reduces clutter)

strFilePath = AddBackSlash(DEF_BACKUP_DIR) & FSO.GetBaseName(strOriginalPath) & ".zip"

Call ClearMenuAndPrompts

' -- Display current file in prompt area

Call WriteString("Backing up file, please wait..." & strBackupPath)

' -- Save current file with new name and continue

If SaveMCAs(strBackupPath, True) Then

' -- Build the command string for zipping (I'm having to truncate the exe's path, and

' -- quote the zip name and file name, go figure..)

strName = strZipPath & " " & C & strFilePath & C & " " & C & strBackupPath & C

' -- Fire the zipping event

Call WriteString("Creating .zip file. Please wait..." & strFilePath)

Call ShellAndWait(strName, True)

' -- Error?

Else

ShowString "Could not backup file to " & DEF_BACKUP_DIR & DEF_CENTERED

End If

' -- Switch back to original file

Call SaveMCAs(strOriginalPath, True)

' -- Clean up

Call ClearMenuAndPrompts

Call RepaintScreen (True)

Dim fsoDelFile

Set fsoDelFile = CreateObject("Scripting.FileSystemObject")

fsoDelFile.DeleteFile(strBackupPath)

 

 

Else

' -- Folder error. DOH!

ShowString "Folder " & DEF_BACKUP_DIR & " does not exist!" & DEF_CENTERED

Exit Sub

End If

' -- Generate error message and clean up

If Err Then Call TrapError("Sub::Main", Err, True)

Set FSO = Nothing

End Sub

 

' -----------------

' | Catch Errors |

' ------------------------------------------------------------------------

Sub TrapError(sSource, objErr, bLogIt)

Dim sMSG

Dim sLogError

Dim FSO

sMSG = "Following error occurred in this script:" & DEF_CENTERED & vbCrLf & vbCrLf

sMSG = sMSG & objErr.Description & DEF_CENTERED & vbCrLf

sMSG = sMSG & "Number: " & objErr.Number & DEF_CENTERED & vbCrLf

sMSG = sMSG & "Source: " & DEF_CENTERED & sSource

ShowString sMSG

If bLogIt Then

sLogError = "Error " & objErr.Number & " in " & sSource & ":" & vbCrLf & objErr.Description

Call WriteLog(sLogError)

End If

objErr.Clear

Set objErr = Nothing

End Sub

 

' ----------------

' | Script Engine |

' ------------------------------------------------------------------------

Function GetScriptEngineInfo()

On Error Resume Next

Dim s

s = "" ' Build string with necessary info.

s = ScriptEngine & " Version "

s = s & ScriptEngineMajorVersion & "."

s = s & ScriptEngineMinorVersion & "."

s = s & ScriptEngineBuildVersion

GetScriptEngineInfo = s ' Return the results.

If Err Then Call TrapError("GetScriptEngineInfo", Err, True)

End Function

 

' ----------------

' | Add Backslash |

' ------------------------------------------------------------------------

 

Function AddBackSlash(sPath)

If Right(sPath, 1) <> "" Then sPath = sPath & ""

AddBackSlash = sPath

End Function

 

' -----------------

' | Drawing exists? |

' ------------------------------------------------------------------------

Function IsDrawing()

Dim Ret

Ret = StartDBSearch(mc_alive, -1)

IsDrawing = Ret

End Function

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...