Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined shape # on refresh after purging missing shx

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
bemonddgs
2330 Views, 3 Replies

Undefined shape # on refresh after purging missing shx

First of all, hello to the community! This'll be my first post on these forums, but i've been using them quite a lot to answer my problems with CAD. Lots of respect for everyone here.

 

So I have this singular problem and haven't been able to find someone else that had a similar experience. It all started with my desire to remove the "missing shx file" notification we have on almost every CAD drawing we do. It's mostly due to the fact we re-use a lot of old drawings as a base for similar projects and at some point, one of those was a file from outside and those pesky shx files didn't come with it and now we're stuck with them. It's mainly just an annoyance, but I'm trying to fix the mess by creating a clean, useful template. So today I decided to tackle that problem and get rid of the notification.

 

I looked on the web, didn't find much here, but on other sites, there was a lisp routine that apparently did just that : Link  Given, it is dated almost 5 years ago, but the article sin't that old and still referencing it, so I tried. Course I first had to figure out lisp routines, and learned in the process that LT version can't run lisp routines. Fortunatly, we still have a full version of 2011 installed, exactly for stuff like that so I opened my future template in 2011, ran the routine, and this is what the console gave me :

 

Command: pshx
Change mtqroman.shx on ltypeshp.shx
Change romansf.shx on ltypeshp.shx
Change romansf.shx on ltypeshp.shx
Change romansf.shx on ltypeshp.shx
Change SASB____.pfb on ltypeshp.shx
Change  TECHCAD.SHX on ltypeshp.shx
Change TECHCAD.SHX on ltypeshp.shx
Change mtqroman.shx on ltypeshp.shx
Change CADARP.shx on ltypeshp.shx
Change mtq.shx on ltypeshp.shx
Change C:\Users\bemond\Documents\talus_shape.shx on ltypeshp.shx
Change C:\Users\bemond\Documents\Xshape.shx on ltypeshp.shx

Now first of all, those 2 last lines meant that the routine did something to my custom shapes, which are not missing. So I REFRESHed to see the changes and as I thought, the custom lines containing my custom shapes were back to continuous. Reloading the line definition fixed that problem, but now everytime I refresh, I get 80+ "undefined shape #xx". I saved the routined drawing to a different name I'll call "test" here and kept the original. Things seem to be happening differently for me than other users :

 

1) Opening the test drawing doesn't give me any notification about shx files. Opening the original still does. So far so good.

2) Refreshing the test drawing, wether in 2011 or 2014 LT, gives me "undefined shape #". Refreshing original does not, even when both are openend at the same time.

3) If I open the test drawing in 2014 LT, and then try to reload my lines, it throws me an error that the line definition of every linetype using shapes in the original acadiso.lin is wrong. I cannot reload those line. My custom_lines.lin can be reloaded without any problem. Now thats more of a problem. 

4) Same problem as 3) happens when I try to reload lines in my original drawing AFTER I open the test drawing. Problem persists even after closing test drawing, but is fixed on autoCAD restart.

5) problems 3) and 4) don't happen on 2011 full version.

6) I don't have any problem writing text, there are no intrusive error messages, but i noticed in my Style manager that some style reference to ltypeshp.shx as the font and there is a little yellow triangle on it.

 

It obviously have something to do with the routine messing with the ltypeshp.shx file somehow, but I dunno how or why. I just wanted to get rid of everything referencing to missing shx.

 

So, anyone knows what's going on here? Since I can still work on the original without any problem, it's not dramatic, but I'd really like to know what didn't work.

 

Thank you.

Civil Engineer & Project Manager
3 REPLIES 3
Message 2 of 4
dmfrazier
in reply to: bemonddgs

To the best of my ability to interpret, the PSHX.lsp file (found here: http://autocadtips.wordpress.com/2013/06/03/autolisp-purge-missing-shx-files/) does this:

1. Looks through the drawing for every textstyle and gets the name of the font file it references.

2. If the font file name does not include the file extension, it appends ".shx" to the file name.

3. Looks for a file of that name in AutoCAD's support files search path or current folder.

4. Looks for a file of that name in Windows' font folder.

5. If it doesn't find a file of that name in either of those places, it runs this code: (vla-put-fontfile item "ltypeshp.shx"), followed by some prompts on the command line as you posted in your message.

 

I think step 5 replaces whatever font was referenced with ltypeshp.shx, but I don't know why that font would have been chosen.

Another issue is at step 2, where the code "assumes" any reference to a font file without an extension is supposed to be an SHX file.  I would think some of your styles probably use ttf files.

Message 3 of 4
bemonddgs
in reply to: dmfrazier

Thank you for your response. I didn't find why it was doing what it was doing, but at least you convinced me not to use the lisp. I finally managed to find a solution to the root of my problem, which was those pesky missing .shx files. turns out, someone made an app to scan drawings and detect which linetypes and textfonts are using missing shx files. Best thing is, it doesn't change a thing in the drawing, just spew out a report. Turns out I had 3 faulty linetypes that I promptly hunted down and purged and my problem is fixed. 

 

For anyone interested in that wonderful little piece of code here is the link. (On the download page, click on the little floppy drive icon >_<)

 

Topic closed... although I don't know how to close a topic sorry 😞

Civil Engineer & Project Manager
Message 4 of 4
dmfrazier
in reply to: bemonddgs

You're welcome.  Good to hear the issue is resolved, and thanks for posting the link.

 

To "close" a topic, simply mark one of the messages in the thread as the solution (even if it's your own, which in this case seems entirely appropriate).  (There should be a button at the lower-right to do this.)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost