Confirm Your Download
Your info
First name*
Last name*
Country/Region*
+
Phone number*
Industry*
Company/Institute*
Usage type*
Business
Personal
Education
By submitting this form you agree to ZWSOFT's Privacy Policy and would like to receive news about ZWSOFT.
Home Page ZWCAD Functions & Commands How to Create a Custom Line Type in ZWCAD

How to Create a Custom Line Type in ZWCAD

When working with technical drawings, line types play an important role in conveying design intent and improving drawing readability. Standard line types may not always meet specific industry or project requirements, especially when custom patterns, symbols, or text are needed. In such cases, creating a custom linetype in ZWCAD allows you to better control how information is visually presented.

Note:

ZWCAD perpetual licenses are not available in the USA and Canada. Please check ZWCAD Flex subscription plans.

This article explains how ZWCAD linetypes are defined and guides you through the process of customizing them efficiently.

 

Method 1: Using the Express Tools

This method creates a custom linetype through ZWCAD’s built-in Express Tools, providing a guided, visual workflow that does not require manual code editing. It is especially suitable for users who prefer menu-based operations or are new to linetype customization, as it allows you to generate a linetype directly from existing drawing objects with minimal setup.

 

1.  First, draw the line type that you want. Then click Express > Tools > Make Linetype. (You can choose to type MKLTYPE in the command line to perform this step)

click Express > Tools > Make Linetype

 

2.  Enter a file name, then click Save.

 Enter a file name

 

3.  Enter a linetype name, and press the Enter on your keyboard to complete the operation.

 Enter a linetype name

 

4.  Enter a linetype description. You can describe it using text or symbols—just make sure it is clear and easy to understand. Then press the Enter to complete the operation.

Enter a linetype description

 

5.  Specify the starting point and click to confirm.

Specify the starting point

 

6.  Specify the ending point and click to confirm.

Specify the ending point

 

7.  Select the line object and press Enter to create the linetype.

Select the line object

 

8.  Your linetype is now created and can be found in the Properties panel.

find the custom line type in the Properties panel

 

You can insert text into the linetype as well. Be sure to choose Single Line Text when entering text to avoid formatting issues.

 insert text into the linetype

 

Repeat steps 1–8, and you will obtain a linetype with text.

use the custom linetype with text

 

Method 2: Using File Editing

This method creates custom linetypes by directly editing a .lin file, offering greater flexibility and control over line patterns, spacing, and embedded text or symbols. This approach is more suitable for advanced users or those who need precise, reusable, or standardized linetypes for long-term projects or team workflows.

 

1.  Open the folder where the line type files are stored on your computer. ( Users > Administrator > AppData > Roaming > ZWSOFT > ZWCAD > 2026 > es-ES > Support)

 Open the folder where the line type files are stored

 

2.  The ZWCAD line type is defined by a .lin file. So create a new .lin file (you can copy an existing one, clear its content, and start defining your custom line type by writing code). You can save the new file to your desktop for easier editing and quick access.

create a new .lin file

 

What you should know about the code:

When creating a line type in a .lin file, each definition has two parts:

a.  Header line – starts with *, then the line type name, a comma, and a short description.

b.  Pattern line – describes how the line is drawn:

A means the line is justified (fits evenly along the length).

Numbers tell the program the lengths of lines and spaces: Positive numbers = line segments, Negative numbers = spaces, 0 = a dot.

Everything is separated by commas.

So 3,-1,1,-1 means: draw a line 3 units long, leave a space 1 unit, draw a line 1 unit, leave a space 1 unit, then repeat.

 

3.  Download the line type you created by following steps.

Download the line type: click OTHERS

Download the line type: click LOAD

Download the line type: click BROWSE

Download the line type: open your file

Download the line type: choose the created linetype

Download the line type: use the created linetype

 

You can also insert text into the linetype by modifying the code.

 insert text into the linetype by modifying the code

 

Its structure is similar to the above line type, except that there is a separate representation code when adding words or symbols.

· [ ] represents the style of the text or symbol

· "test" means the text needs to be added to line type

· STANDARD means the text style

· S means the magnification ratio

· R means the rotation angle

· X indicates that the text is displayed on the X axis

· Y indicates the displacement on the Y axis

 

Once downloaded, you can use the created linetype. The result will appear as shown in the picture:

use the created linetype

 

Best Practices

 

Plan the linetype structure in advance

Before creating a custom linetype, take a moment to plan its overall structure. This includes deciding the length of each line segment, the spacing between segments, and the placement of any text or symbols. Proper planning helps avoid repeated adjustments later and ensures the linetype behaves as expected in real drawings.

 

Use clear and recognizable names

Always use clear and meaningful names and descriptions for custom linetypes. This makes them easier to identify when working with complex drawings or shared projects, and helps other team members quickly understand their purpose without confusion.

 

Keep proper proportions for segments and gaps

Maintain reasonable proportions between line segments and gaps. If the spacing or segment length is poorly balanced, the linetype may appear uneven or distorted when the drawing is zoomed in or out. Well-proportioned values improve readability at different scales.

 

Test text-based linetypes at different scales

When a linetype includes text, always use single-line text and test the result at multiple scales. This helps ensure the text remains legible, properly aligned, and does not overlap or disappear when the drawing scale changes.

 

Back up the original .lin file before editing

Before editing a .lin file, it is strongly recommended to create a backup of the original file. This allows you to quickly restore the default settings if an error occurs or the custom definition does not work as intended.

 

FAQs

Why doesn’t my custom linetype display correctly?

This usually happens when the segment lengths or spacing values in the .lin file are not well balanced.

Another common reason is that the linetype scale (LTSCALE or object scale) does not match the drawing scale. Try adjusting the linetype scale or refining the numeric values in the pattern definition.

 

Why doesn’t the text appear in my custom linetype?

If the linetype includes text but it does not appear, make sure the text style referenced in the .lin file exists in the drawing. Also confirm that single-line text is used and that the text size is appropriate for the current scale.

 

Can I edit an existing linetype instead of creating a new one?

Yes. You can modify an existing linetype by editing its definition in the .lin file. However, it is recommended to create a copy and edit the duplicated definition to avoid affecting default or commonly used linetypes.

 

Why does the linetype look fine in one drawing but wrong in another?

Linetype appearance is affected by drawing scale, linetype scale settings, and unit differences between files. When reusing a custom linetype in another drawing, always check scale-related settings to ensure consistent results.

 

Do I need to restart ZWCAD after editing a .lin file?

In most cases, restarting is not required. You can reload the linetype within the drawing. However, if the new definition does not appear, restarting ZWCAD can help ensure the file is fully refreshed.