How to Create a Simple Custom Linetype in AutoCAD from Scratch
A custom linetype does not require a plug-in or programming environment. A simple pattern can be written in a plain-text LIN file, loaded into a drawing, and assigned to a layer or object. This tutorial creates one dash-dot definition from beginning to end.
Before starting, review what a CAD linetype controls and the difference between simple and complex linetypes. The example below is intentionally simple so that every character in the definition can be checked.
What You Will Create in This Tutorial
You will create a linetype named CADLT_DASHDOT. Its repeating cycle contains a long dash, a gap, a dot, and another gap. The completed source will contain only two required lines:
*CADLT_DASHDOT,Dash dot __ . __ . __ .
A,0.50,-0.25,0,-0.25
The values are test values in drawing units. Their apparent size will still depend on the drawing’s linetype scale settings, which are covered separately in the LTSCALE guide.
Prepare the LIN File
Choose a Plain-Text Editor
Use an editor that saves unformatted text, such as Notepad on Windows, TextEdit in plain-text mode on macOS, Visual Studio Code, or another code editor. Do not use Word or a rich-text editor. Smart quotes, hidden formatting, and automatic substitutions can invalidate a LIN definition.
Create a Dedicated Custom Linetype File
Create a new file named cadlt_custom.lin. A separate file is easier to back up, distribute, and maintain than a definition buried inside a default Autodesk library. One LIN file can later contain many custom definitions.
Avoid Editing acad.lin and acadiso.lin Directly
acad.lin and acadiso.lin are Autodesk’s standard imperial and metric libraries. An update, repair, migration, or reinstall can replace them. Keep company content in its own file and add its folder to the support path when the library becomes permanent.
Write the Linetype Header
Add the Linetype Name
The header begins with an asterisk immediately followed by the name:
*CADLT_DASHDOT
Use a unique, descriptive name. A company prefix such as CADLT_ reduces conflicts when objects are copied from another drawing that already contains a different definition called DASHDOT.
Write a Clear Description
Add a comma after the name, followed by a short description:
*CADLT_DASHDOT,Dash dot
The description appears in linetype-selection interfaces. It should explain the pattern or its intended use without repeating a long project specification.
Add a Visual Pattern Preview
You can extend the description with a symbolic preview made from underscores, spaces, and dots:
*CADLT_DASHDOT,Dash dot __ . __ . __ .
This preview is descriptive text only. It does not control the actual dash or gap lengths.
Define the Dash, Gap, and Dot Pattern
The second line begins with the A alignment code and then lists comma-separated values. The pattern is read from left to right and repeated along the object.
Use Positive Values for Dashes
A positive number is a pen-down distance. AutoCAD draws a segment for that length. In the example, 0.50 creates the long dash.
Use Negative Values for Gaps
A negative number is a pen-up distance. AutoCAD advances along the path without drawing. Each -0.25 value creates a quarter-unit gap around the dot.
Use Zero to Create Dots
A value of 0 creates a dot. It is not a tiny positive dash. Its plotted appearance can be affected by lineweight and output resolution, so always check the final PDF or print.
Save the LIN File Correctly
Use the LIN File Extension
Save the file as cadlt_custom.lin, not cadlt_custom.lin.txt. On systems that hide known extensions, enable visible extensions before assuming the name is correct.
Check the File Encoding
For a basic numeric pattern, use a conventional plain-text encoding and ordinary ASCII characters. Avoid typographic quotes and unusual punctuation. Complex multilingual text should be tested separately with the exact font and CAD products used by the project.
Store the File in an Accessible Folder
For the first test, the Desktop or a project test folder is sufficient. For production, move the file to a managed support location described in the LIN file and support-path guide.
Load the New Linetype in AutoCAD
Open Linetype Manager
Run LINETYPE, or open the linetype controls through Layer Properties Manager. Choose Load to open the list of available definitions.
Select the Custom LIN File
Use the file-selection button to browse to cadlt_custom.lin. AutoCAD reads the headers in that file and lists the definitions it can parse.
Load the New Definition
Select CADLT_DASHDOT and confirm. Loading copies the definition into the current DWG. The source file remains important for maintenance and future drawings, but the current drawing now contains its own loaded record.
Assign the Linetype
Assign It to a Layer
The preferred production method is to assign the linetype to a correctly named layer, then draw objects ByLayer. This keeps the graphic standard centralized and makes later changes easier.
Assign It Directly to an Object
For a quick test, select a line and choose CADLT_DASHDOT in the Properties palette. Direct assignment is useful for diagnosis, but it should not replace a consistent layer standard. See ByLayer, ByBlock, and direct assignment for the full property hierarchy.
Set It as the Current Linetype
You can make the loaded definition current for newly created objects. In a managed drawing, however, keeping object properties ByLayer is usually safer than changing the current object linetype.
Test the Linetype in a New Drawing
Draw Lines of Different Lengths
Draw one short line, one line several pattern cycles long, and one very long line. A short line may not have enough length to display the complete cycle; this is explained in the guide to continuous-looking short lines.
Test Horizontal, Vertical, and Diagonal Lines
A simple dash-dot pattern should remain consistent in every direction. Direction testing becomes even more important when text or SHX shapes are later added.
Regenerate the Drawing
Run REGEN after loading or changing a definition. If several viewports or spaces are involved, use REGENALL and compare model space, paper space, and plot preview.
Common Beginner Mistakes
Incorrect Commas or Line Breaks
The header and pattern must be on separate lines, and every pattern element must be separated by a comma. One missing comma can produce a Bad Definition error or prevent the linetype from appearing in the load list.
Missing the A Alignment Code
The pattern line must begin with A. This leading alignment token is different from the A= absolute-rotation parameter used inside complex text or shape descriptors.
Reusing an Existing Linetype Name
If the drawing already contains the same name, AutoCAD may retain the stored version until you deliberately reload it. Unique names prevent silent conflicts between company, client, and consultant libraries.
Saving the File as TXT Instead of LIN
If AutoCAD cannot find the definition, inspect the real filename first. A file that appears as cadlt_custom.lin in Finder or File Explorer may still have a hidden .txt extension.
Complete Simple Linetype Example
*CADLT_DASHDOT,Dash dot __ . __ . __ .
A,0.50,-0.25,0,-0.25
Once this definition loads correctly, make one controlled change at a time. For example, change the first dash from 0.50 to 0.75, save, reload the definition, and compare the result.
Final Checklist Before Production Use
- The file is plain text and ends in
.lin. - The header and pattern are on separate lines.
- The definition has a unique name and clear description.
- The pattern loads without warnings in a blank drawing.
- Short, long, horizontal, vertical, and diagonal lines were tested.
- The result was checked in plot preview and PDF output.
- The source file is stored in a backed-up support location.
