Tips and Tricks - Dealing with problematic files

In your line of work, sooner or later, at some point you will come across a problematic file. By problematic, I mean a file with errors or even corrupted.

If some errors/problems can be avoided by doing “some maintenance” to your drawings ( keeping a good file structure, or check/enforce quality/standards in your drawings), others simply cannot, like when your machine crashes in the middle of your work, or you are dealing with files that were provided by a client, for example.

DraftSight has tools that can help you detect, but also fix errors, and when that is not possible, there are actions you can take in order to recover your drawing, or at least most of the information. Most importantly, there are actions and options you can take/set, in order to minimize the chance of having to deal with problematic files.

-  File doesn’t open

The most evident and perhaps concerning error/problem, is when you try to open a file, and the application fails to do so. Fear not: There’s hope!

The Recover option

If a file doesn’t open when you double-click on it, you can try to use the Recover option. Often files that can’t be open in a “standard” way can be recovered using this process.

Launch DraftSight

-  In the DraftSight Menu, Click File, and then the Recover option. Locate the file, and Click Open.

The Recover option on Open, scans/checks the file for errors, and fixes them while opens them. Once the file is open, in the command line you can see the results of the recovery process as shown below:

 

You can use this information to help you identify the cause of the errors, and address them.

The Insert method

Ok, what if the file is corrupted, and is not recoverable? Well, there still a couple of actions you can try:

-          Open a new drawing, and try to insert the problematic file (using the Insert as Block and/or Reference Drawing). If it works, use the command _EXPLODE or BIND depending on the insertion option/method you used. Note: you might have to run the command _EXPLODE more than once, to access the geometry of the inserted drawing. Then, Run the command _CHECK to search for, and fix any error.

For extra safety, you can use Edit Copy, and paste the geometry to a new file/to one of your Template files.

Backup files

Recover file, through Backup files.

Rename the Drawing’s backup file, by changing his filename extension from .BAK to .DWG, and try to open it.  And speaking of backup, here is how to set the backup saving intervals in your drawing:

                 The variable SETSVTM controls the automatic save interval in minutes. Type SETSVTM in your command line to access the variable. The values accepted range from 0 ( automatic save turned off) to 600. The timer starts as soon as you make a change to a drawing. It is reset and restarted on manual saving operations on the file.

Temporary files

Temporary files are other option to consider when trying to recover files. Temporary files are files with extension .DS\\\$, and like for .BAK files, you can use them by changing the file extension to .DWG.  To set/check Temporary files storing location, Go to Menu, Options, File Location, and expand the node System. The file path where these files are stored is under Temporary File Location.

 

 -  Before the big problems

File starts to present wrong results and/or unexpected behaviours.

Not all errors/corruptions are so obvious or breath taking as not being able to open a file, but that doesn’t mean that they’re not equally serious. Imagine a corrupted block file, used in a production environment, in hundreds of different drawings, replicating one problem in all of them!

If a file starts to present wrong results and/or unexpected behaviours, there’s a command you can use to identify underlying errors: the command _CHECK .

The command _CHECK  searches the drawings for errors and on your input, can automatically fix them. Here’s an example of a result:

 

 

The summary of the command can also give you clues on what might be causing the problems (e.g. in this case, Attributes of a Block, and Multiline Text Properties). This information allows you to, if not identify the cause of the issues, at least narrow the possible causes, and replace them or re-create them.

 

-  What Next? Preventing redundancy/occurrence of errors

Either you recovered a problematic file, detected and fixed errors in your drawing, and/or just want to protect the integrity of your files, here are a few tips on how to do it:

-          Either you just recovered a file, or using a “healthy” file, Clean your files. This not only will improve performance (and reduce the file size dramatically as well) when you are working, but will also prevent the appearance of errors related with unused settings, and/or referenced files/settings/definitions. Run the command _CLEAN, and delete whatever isn’t in use. Run it more than once. The structure of some files with nested blocks, for example, imply that only when the parent discardable entity is deleted, the others will show.

-          Make sure your Blocks/Library of Blocks is optimized. Run _CLEAN and _CHECK on the Block files, not only on the files where they are used.

-          You might often deal with files from suppliers/clients. There are lots of applications with dwg and/or dxf as native format, or able to export files in these formats. Often there’s product specific functionalities to every application, that regardless of being transmitted in the file, can sometimes cause problems. When receiving files from a third party, spend a minute or two, yes, you guessed, Run _CLEAN and _CHECK on the files. If/when possible, transfer the geometry/drawing information to one of your Templates (that you already checked, right?), and to your company drawing standards. Simplify geometry, if you have to. A Line is a Line in most of the applications. A more complex entity, eventually created with a product specific functionality is more likely prone to errors, when loaded/handled in a different application. It’s not a rule, but I think it explains the advantages of simplicity/neutrality of the geometry used.

-          Set your automatic save. A couple of seconds can prevent the loss of hours of work.