How to Fix Bad Definition, Missing SHX, and Garbled Linetype Text Errors
A linetype can fail during loading, display the wrong characters, or lose its symbols for three different reasons: invalid LIN syntax, an unavailable SHX shape, or a missing or substituted text resource. Treating every symptom as a scale problem wastes time.
Use a small test file and isolate one dependency at a time.
Identify the Type of Linetype Error
LIN Syntax Error
A loading message such as Bad definition usually points to malformed structure, punctuation, numeric elements, or a complex descriptor AutoCAD cannot parse.
Missing Shape File
The definition can load but the expected custom symbol is absent, replaced, or reported as an unavailable SHX resource.
Missing Font or Text Style
Embedded text can use an unexpected font, become boxes, or fail when the referenced text style does not exist as expected.
Unsupported Character or Encoding Problem
Smart quotes, nonstandard minus signs, invisible characters, or unsuitable file encoding can corrupt an otherwise correct-looking line.
Fix a “Bad Definition” Error
Check the Two-Line Definition Structure
The header beginning with an asterisk must be followed by its pattern line. Do not merge the two lines or place another header where pattern data is expected. Review the complete LIN structure guide.
Check Commas and Brackets
Numeric elements require commas, and text or shape descriptors require correctly paired square brackets. Remove trailing punctuation that creates an empty element.
Check Positive, Negative, and Zero Values
Positive values draw, negative values create gaps, and zero creates a dot. Use a period as the decimal separator in the file and verify every value is numeric.
Check Text and Shape Descriptors
Confirm the text string or shape name, style or SHX filename, and parameters such as S, R, U, X, and Y. Use the complex-code reference for valid descriptor structure.
Find the Exact Invalid Definition
Load One Linetype at a Time
Do not load a large library while debugging. Copy the suspect definition into a temporary LIN file and load only that name.
Create a Minimal Test LIN File
Start with a simple valid two-line pattern. Then add the text or shape descriptor. This confirms whether the failure belongs to basic syntax or the external component.
Remove Parameters Until the Definition Loads
Temporarily remove offsets and rotation parameters, then restore them one at a time. The first reintroduced failure identifies the invalid token.
Fix a Missing SHX Shape File
Identify the Required SHX Filename
Read the shape descriptor in the LIN file. The filename inside the brackets is the required compiled resource.
Locate the Original File
Search the project package, company library, author’s support folders, and previous approved deliveries. Do not download an unrelated file with the same generic name.
Add Its Folder to the Support Search Path
Place the approved file in a controlled location and add that location to AutoCAD’s support search path. See Windows and macOS LIN/SHX paths.
Replace or Rebuild the Missing Shape
If the source cannot be recovered, recreate the symbol and compile a new SHX using the SHP/SHX creation guide. Give the replacement a unique name and update the LIN descriptor rather than pretending it is the original.
Fix Garbled Linetype Text
Check the Referenced Text Style
The style name in the descriptor must exist and must point to the intended font. A same-named style with different properties can change every label.
Check the Font File
Verify that the SHX or TrueType font is installed and permitted for distribution. Substitute only through an approved standards decision.
Check Special Characters
Use plain ASCII text while debugging. Degree signs, accented characters, and special engineering symbols may depend on font coverage and encoding.
Check File Encoding
Save a diagnostic copy in a simple text encoding supported by the target AutoCAD versions. Remove a byte-order mark if the first definition name is not read correctly.
Fix Incorrect Shape or Text Names
Names are exact identifiers. Check spelling, spaces, underscores, case conventions, and whether a text style was renamed in the drawing. For shapes, confirm both the shape name and the SHX filename.
Reload the Repaired Linetype
Save the Corrected LIN File
Save to the approved custom library, not the Autodesk default file. Keep a versioned backup of the previous production definition.
Reload the Definition
Use LINETYPE or -LINETYPE to load the existing name from the corrected source. A stored drawing record does not update simply because the text file changed.
Regenerate the Drawing
Run REGENALL and inspect a long sample. Reopen the drawing if cached display persists.
Test the Repair in a Blank Drawing
Create a clean DWG with no company template, add only the required support path, load the repaired definition, and test straight, reversed, curved, and short objects. A blank test avoids conflicts with an older stored definition.
Prevent Future LIN, SHX, and Font Errors
Use Standard Folder Structures
Keep LIN, source SHP, compiled SHX, fonts, test drawings, and documentation in predictable folders.
Use Portable File Names
Prefer short names without ambiguous punctuation. Use a company prefix to reduce collisions.
Package Dependencies with the Drawing
Use the eTransmit workflow and test the package on a clean system before delivery.
Complete Error-Diagnosis Workflow
- Record the exact message and linetype name.
- Copy the definition to a minimal test LIN file.
- Validate its two-line structure and punctuation.
- Reduce complex descriptors to the simplest valid form.
- Confirm text style, font, shape name, and SHX filename.
- Verify the support path on the target platform.
- Reload the definition and regenerate.
- Test in a blank drawing and a clean user environment.
- Update the controlled library and transmittal documentation.
