Select Shape File

If you receive a dialog box with this title while opening a drawing, you are missing a shape file that is referenced in the drawing. Shape files contain shapes that can be used by themselves, sort of like blocks. Most likely though, they are part of a complex linetype definition.

Dialog Example

If you do not have access to the shape file, let's figure out why. Did you receive this drawing from someone else? If so, ask them for the shape file, and then ask them to use eTransmit next time they send you a drawing so this won't happen. eTransmit packages the drawing file together with all dependent files (such as shape files, images, and External Drawing references)

What if this is an internal drawing that you have been working on for a while? In that case, maybe the shape file was moved from it's original location, or maybe your support file search path was changed, and it no longer includes the directory where the shape file lives. In any case, AutoCAD cannot find the shape file. Search your machine and/or your network for this file. The actual shape file name is located in the file name portion of the "Select Shape File" dialog.

If you have made it this far, then I suppose you cannot find the needed shape file. So you have a drawing of unknown origin, you do not know anything about the author, where it came from, etc., but you are still getting the "Select Shape File" dialog upon drawing startup. If you have no hope of obtaining the original shape file, you might as well purge it out since it's not available anyway. Ok, so you run the PURGE command, and it's not listed. Why? Something must be referencing at least one shape in the shape file.

Many times you see people in the newsgroups asking for a certain shape file name. The chances of this working are very slim. Let's say that you are missing a shape file named "pro-lm.shx", and you do happen to find someone who has the same file, it's doubtful that it is the exact same file. Anyone can create a shape file and give it this name. Shape files contain shapes referenced by number. If your drawing uses shape #114 defined in "pro-lm.shx", and you replace it with a file named "pro-lm.shx" that doesn't include shape #114, you are going to be in the same boat as before. Even worse, the replacement file may contain a shape #114 that isn't the same as the original.

How do you find out what is referencing this shape file? Start by looking for complex linetypes. Complex linetypes either reference a font, or a shape file. Purge all linetypes and then see if the shape file can be purged. If not, keep digging. Set all layers to use the Continuous linetype, and make sure all entities are set to Bylayer linetype. Purge again. This should free up the shape file for purging if it was referenced in a linetype.

If that didn't do it, run QSELECT and see if any SHAPE entities are present in the drawing. If so, you can select and delete them even though they are not visible.

Lastly, try this lisp file.
This will search for three things.

1) Complex linetypes that reference a shape file.
2) All loaded shape files.
3) Any inserted shapes.

Still stuck? If you are still stuck after all this, head over to http://www.manusoft.com and take a look at SuperPurge. It has a "hard purge" feature that will purge anything (read the warnings...)

As always, whether you are doing this manually, with the attached lisp, or with a product like SuperPurge, work on a backup of your drawing until you are sure what you are doing. Good luck.

Feel free to let me know if none of these suggestions work. You can even send me a drawing if you wish. I have only tested these suggestions on a limited number of drawings, and I'm sure there are some cases out there that I have not covered.

UPDATE: MARCH 2010: AutoCAD 2011 allows you to automatically ignore prompts for missing shape files. Read more

Comments

Four year old post...and I'm glad I found it!

I tried everything, including super purge.
I have several drawings with this problem. Some drawings I have to cancel 8 shape files when opening.
I know where we got the files...they are adament that they cannot locate the shape files.
Is there nothing I can do?
Thanks so much.

The attached LISP (fndshape.lsp) worked a treat! Rather than forceably removing anything it lets you see where the troublesome shape file is so you can manually decide the best cause of action ...simple but very effective.

Thanks

Thanks Marc

I used the lisp file and changed my lines to contiuous, purged and no longer had any problems

Thanks for the feedback.

Hi There,
thank you very much for your detailed instructions.

worked well for one of my drawings, what a relieve!!
i'm still searching to make it work for the second drawing which is a drawing i received from an external source,

thansk again

Thanks - the .lsp file just worked very fine.I almost tried to purge the drawing, fix the missing fonts and text styles, changed line types... And nothing worked. This is sure very helpful.Thanks again.

I've tried everything you stated here.

Qslect does not list any shape files.

I've tried delshape.lsp and it says there "No unreferenced shape files found"

superpurge costs money.

The lsp routine lists all the shape files and says they are loaded, yet everytime i open the drawing I have to cancel through all 20 files.
This is the information I get and I am not sure what to do with it.
[C:\aa-work\EC-LEGEND\SANDBAG] does not exist in my computer.

LINETYPE [FENCE2] uses SHAPE # [1] in the file [fencepole]
The following SHAPE FILE is loaded: [fencepole]
The following SHAPE FILE is loaded: [C:\aa-work\EC-LEGEND\SANDBAG]
The following SHAPE FILE is loaded: [C:\aa-work\EC-LEGEND\SILT]
The following SHAPE FILE is loaded: [C:\AA-WORK\EC-LEGEND\.\.\STRAWBALE]
The following SHAPE FILE is loaded: [C:\aa-work\EC-LEGEND\WATTLE]
The following SHAPE FILE is loaded: [RETWALL]
The following SHAPE FILE is loaded: [fencepost]
The following SHAPE FILE is loaded: [L1.shx]
The following SHAPE FILE is loaded: [L2.shx]
The following SHAPE FILE is loaded: [L3.shx]
The following SHAPE FILE is loaded: [L4.shx]
The following SHAPE FILE is loaded: [L5.shx]
The following SHAPE FILE is loaded: [hex.shx]
The following SHAPE FILE is loaded: [BLK1.shx]
The following SHAPE FILE is loaded: [BLK2.shx]
The following SHAPE FILE is loaded: [slash.shx]
The following SHAPE FILE is loaded: [slashm.shx]
The following SHAPE FILE is loaded: [Sandgravbag.shx]
The following SHAPE FILE is loaded: [SILT]
The following SHAPE FILE is loaded: [STRAWBALE]
The following SHAPE FILE is loaded: [WATTLE]

If you want, send me the drawing. I'll take a look at it...

just sent it to you.
thank you.

Wblocking out the drawing ended up weeding out 99% of the shape files and then I was able to find the one last rogue shape in a line type and then purged and deleted it. whew!
Thank you for you help!

Could you assist with opening a file requesting shape file. Thank you.

Step-3 of Fndshape.LSP only seems to detect shapes that have been placed directly into the drawing, not shapes that a part of Blocks within the drawing. Is there a newer revision that will identify Shape occurrences within Blocks?

I found the routine below (which identifies and lists Blocks used in a drawing) on another forum. I have been unsuccessful so far at incorporating this into Step-3 of FndShape as my AutoLisp skills are very limited. I am attempting to locate Shapes nested within Blocks. Can anyone provide any hints or guidance as to what must be done, or at least let me know if I'm trying to do the impossible?

Thanks!

============================================================================
(defun digx (/ x_appid x_appid_lst x_appid_ent x_blk x_data x_ent)
  ;;  Get a list of all appid's
  (while (setq x_appid (tblnext "appid" (null x_appid)))
    (setq x_appid_lst (cons (cdr (assoc 2 x_appid)) x_appid_lst))
  ) ;_ end_while
  ;; Loop through all blocks
  (while (setq x_blk (tblnext "block" (null x_blk)))
    (setq x_ent (tblobjname "block" (cdr (assoc 2 x_blk))))
    (princ (strcat "\n-----    BLK: " (cdr (assoc 2 x_blk)) "     -----"))
    ;; Loop through all Blocks' Entity
    (while (Setq x_ent (entnext x_ent))
      (foreach x_appid_ent x_appid_lst ; Loop through appid
        (if (setq x_data (assoc -3 (entget x_ent (list x_appid_ent))))
          (princ (strcat "\n  Xdata => " (vl-princ-to-string x_data)"\n"))
        ) ;end if
      ) ;_ end_while
    ) ;_ end_while
  ) ;_ end_while
  (princ)
) ;_ end_defun
(digx)

That code is looking for APPIDS.
What we need is code that can iterate each block in the block collection, looking for a shape. This could be a pretty intensive task, depending on the number of blocks and the number of entities in each block. I'll try to look into this soon.

Thanks....... I'm looking forward to see what you come up with.

The FNDSHAPE.lsp provided all the clues I needed to find the references to missing shx files, allowing me to identify & purge the linetypes and then the missing shx files that were unavailable.

Thanks for hosting this wonderful site!

 


All content is copyright © CAD PANACEA 2005-2013 unless otherwise noted and may not be reproduced. All comments posted to this blog are the sole responsibility of the person making the comment.

Google, as a third party vendor, uses cookies to serve ads on this site. Google's use of their cookies enables it to serve ads to users based on their visit to your sites and other sites on the Internet. You may opt out of the use of these cookies by visiting the Google ad and content network privacy policy.

Powered by Drupal