Cannot find .shx file errors and what to do about it.


Select a Shape File dialog

You open a drawing and unexpectedly get a Select Shape File dialog box.  In this post I will show you how to eliminate this error and also show you how to find the location and explore the contents of a shape file (.shx).


First question, what’s a shape file?
In the context of an AutoCAD environment a shape file means a file with a .shx file extension. It is a compiled shape file (a binary file). A shape file contains symbols much like an AutoCAD block. Most commonly these symbols are used in custom linetype definitions such as batting (fiberglass batt insulation) or a fence linetype for example. 

Enough with the history lesson I just want to get rid of it.
Lets assume you do not have the .shx file and do not wish to recover its contents.  Your concern is how to make this file selection dialog not appear when opening a drawing. The solution: delshape.lsp 

I found a copy of the missing .shx file.  Where do I put it?
That’s a loaded question that my best friend is all to eager to answer, “I’ll tell you where to put it”.  The AutoCAD search path is all that is really necessary to bring this file into play for your system.  Other shx files are found in your support folder. To find this folder just open the OPTIONS dialog box by right clicking on the command line.  Go to the Files tab and pick the plus sign next to the Support File Search Path category (first on the list).  Under your Windows user profile is where you will find a support folder.  Any one of the folders listed here will work, its just a cleaner solution to keep similar files together under the same folder.  

Tip: When customizing AutoCAD my recommendation is to add your own folder to the Support File Search Path and place your files in your folder.  If you change to a newer release it will be much easier to migrate your customizations by keeping them separate from the standard installation folders that AutoCAD creates. 

How do I find out what’s inside a .shx file?
You are at the point now where your inquisitive mind just cannot let it go.  Great question with a simple answer. (phew, my lunch break is almost over and you have yet to get to the punch line).  Type SHAPE on the command line and hit <enter>.  You are bright people, I don’t really need to keep saying “and hit <enter>”.  Follow the command prompts and enter ? then * to get a complete list of the loaded Shape names and the .shx file that contains those definitions.   

In this example of the AutoCAD command line output the shapes are found in the linetypeshp.shx file.  This list only contains the shapes in use by a linetype definition currently loaded in the drawing.  It may not represent an entire list of shapes within the .shx file. 

I want a list of all the shapes in a .shx file.
Your insatiable thirst for knowledge has reached its apex.  Now you must know.  Hurry, there’s just a few minutes left to your lunch hour.  Type LOAD.  Go get that .shx file that’s been tormenting you.  Type SHAPE.  You know the drill by now…. and now you have the entire list of each and every shape contained in that .shx file. 

Oh, there’s more to it.  Now that you know the names of the shapes use the SHAPE command and insert each one to see what it looks like.  The clever little chap that I am I pasted the list to MTEXT and inserted each shape next to its name. 

Finally, I used an Express Tool to create blocks from the shapes.  Express > Blocks > Convert shape to block.  We’ll have to save “What to do with blocks” for another post.  

Tip: If you need to convert the compiled .shx file to .shp if you want to look at the shape definitions in a text editor.  Download the public domain SHX2SHP converter by Schreiber Instruments.




As Tigger would say, “TTFN”.