Error: Bad Definition (Loading a Linetype in AutoCAD or F/X CAD)
Issue
You saw a Bad definition error when loading a linetype in AutoCAD (for example: Bad definition of FENCELINE1 at line XXX).
Cause
The error can occur because:
- The Autodesk Support folder may have been removed from the Support File Search Path
- A text style definition in your drawing may be incorrectly using the file ltypeshp.shx as a font
- You may have a corrupt SHP file.
Solution
Step 1: Verify that the Autodesk Support folder is in the Support File Search Path.
1A. Type OP in the Command line and press Enter to open the Options dialog box.
1B. In the Options dialog box, select the Files tab.
Click the plus (+) sign to the left of Support File Search to expand this entry.
Look for an entry similar to the following:
C:\Users\Username\AppData\Roaming\Autodesk\
AutoCAD 20**\Rxx\enu\support
(Where Username is your computer username and 20** is your year version of F/X CAD or AutoCAD. The exact value of Rxx will also vary depending on your version.)
1C. If you don't see this entry, you'll need to add it back.
Click Add, then click Browse.
If you do see this path in the Support File Search Path, move on to Step 2: Check for an incorrect text style definition.
1D. Browse to the C:\Users\Username\AppData\Roaming\Autodesk\
AutoCAD 20**\Rxx\enu\support folder path listed above.
Click the Support folder to select it, then click Open.
1E. The path should now be listed in the Support File Search Path.
Click Apply to save the change. You can now close the Options dialog box.
1F. Open CAD and try to load the linetype again.
Still getting the error? Move on to the next step.
Step 2: Check for an incorrect text style definition.
If the path listed above is in your Support File Search Path but you're still getting the error, your next step should be to check for an incorrect text style definition.
2A. Open the drawing causing the issue.
2B. Type Style in the Command line, and press Enter.
2C. In the Text Style dialog box, select each text style in the Styles area and look for styles that are currently assigned to ltypeshp.shx in the Font Name menu.
In the example to the right, the style TITLE 12PT is assigned the font ltypeshp.shx.
2D. For each style that uses ltypeshp.shx, select another Font Name.
In our example, we've selected the font Swis721 BT for our TITLE 12PT text style.
Click Apply to save your changes. Then click Close to close the Text Style dialog box.
2E. Type Purge in the Command line, and press Enter.
2F. In the Purge dialog box, select the following options:
- Purge nested items
- Purge zero-length geometry and empty text objects
Click Purge All.
2G. Save your drawing.
2H. Close and reopen AutoCAD. (This step is crucial because it clears the cache information, allowing the fonts to be reassigned.)
Still getting the error? You likely have a corrupt SHP file. Move on to the next step.
Step 3: Check for a corrupt SHP file.
At this point, the error is likely resulting from a corrupt SHP file. To resolve the error, you can choose to:
- Follow our steps to reset F/X CAD or AutoCAD to its default settings, or
- Create and compile a new SHP file