AutoCAD has its own library of linetypes which is quite sufficient for most of the common drawings. Still, if you need any special kind of linetype you can make it right inside AutoCAD without using complex methods.
In this article, I will explain all about AutoCAD linetypes, following are the topics which I will discuss here.
Making linetype containing text and symbols
Making linetypes with complex shapes
Modifying linetype file
Importing and exporting linetypes
Making Linetype with text and symbol
Let’s assume that we want a custom linetype containing repeating patterns of text and symbol as shown in the image below.
In this case, the arrows are used from the character map and A letter is Mtext. Let’s start by making this linetype pattern.
Type MTEXT and press enter, now make a box to start writing your Mtext. To add the symbol in this Mtext box you need to select Other option from Symbol tool of Insert panel on the Text Editor tab as shown in the image below.
Now select the Arial font in the character map window and scroll down the list of symbols till you see solid arrows. Select the left pointing arrow then click on the Select button then click the Copy button and close the character map.
Now right click in the text box and select Paste from the contextual menu, you can also use Ctrl + V to paste the character. Now type A and repeat the process of adding the left pointing arrow symbol. After adding text and symbol make two lines of equal length as shown in the image 1.
Our segment of linetype is ready and we can convert it into a linetype. For this, we will use MKLTYPE express tool.
But before using this tool explode the text and arrow symbol. Select the text as well as arrow symbols then type X and press enter. By doing so we can convert a Mtext into simple Text or single line text. MKLTYPE doesn’t recognize Mtext hence we need to convert Mtext into text using explode command before using the command.
Now type MKLTYPE and press enter, Select linetype file window will show up. Specify a location where you want to save this custom linetype and give it a name. In my case, I am selecting desktop as the location and naming it as Sample_Ltype. The linetype will be saved with .lin file extension.
Now the command line will prompt you to specify the name of linetype. I will use ATEXT as the name of linetype. Press enter and it will prompt you for a description, add the description which you want or press enter to skip this.
Now the command line will prompt you to specify the starting point of the line definition. Select the leftmost point on this linetype segment and press enter. Again command line will prompt you for the endpoint of the linetype segment. Click on the rightmost point of the linetype segment and press enter.
Now the command line will prompt you to select the objects. Make a window to select the text, symbol and the lines in the selection window and press enter. Finally, the command line will prompt that the ATEXT linetype is now created and loaded as shown in the image below.
So, now our custom linetype is ready for use, let’s use it in a simple drawing. I will make a circle and a rectangle as shown in the image below and then change its linetype from the properties palette.
After changing the linetype of the rectangle as well as the circle this is how my drawing looked like.
Just like any normal linetype, you can change the scale of this linetype too.
Making linetypes with complex shapes
In this case, I will show you method of making a linetype with complex shape containing arc as well as line as shown in the image below.
Now, in this case, we are using arc which MKLTYPE command won’t recognize and hence we need to convert this complete linetype segment into a “shape” which MKLTYPE command recognizes.
To make the Shape file type MKSHAPE and press enter, select shape window will show up. Specify the location where you want to save the shape file and give it a name. I am saving it on the desktop with name Complex_Shape. The shape will be saved with SHP extension.
Now command line will prompt you to specify the name of the Shape file. In this case, I am using CLT as the name of the shape, after typing the name press enter.
On the next prompt, it will prompt for a resolution value, simply press enter to accept the default value. Now click on the midpoint of the left line to specify the base point then select the complete drawing and press enter.
The CLT Shape file is now created and it can be used for making our linetype.
Type SHAPE and press enter, command line will prompt you to enter the name of shape which you want to insert, type CLT and press enter again. The cursor will now have the shape, click on the midpoint of left line again as marked in the red circle in the image above. This will overlap the shape on existing geometry.
On the next prompts of height and rotation angle simply press enter to accept the defaut values and exit the command. Now we have the shape clearly overlapping the existing drawing.
To start making linetype from this shape you need to start with MKLTYPE command. Type MKLTYPE and press enter. Now Specify a location where you want to save this linetype and give it a name. I am using the desktop as the location and “Complex line” as the name.
Now the command line will prompt you for the name of linetype, type CLINE, and press enter. Press enter again on the next prompt to skip adding any description. Now command line will prompt you to add starting point, click on the midpoint of the left line as shown in the red circle in the image below and second point right opposite as shown with the green circle.
Now click on the shape to select it and press enter. The new linetype with CLINE name is now added and loaded in the drawing.
After applying the new linetype on a circle and a line it looked like this on my drawing.
If the steps are not clear in the article then I suggest you check this video, it explains everything about making simple and complex linetypes.
Understanding and Modifying linetype files
So far we have made linetypes using MKLTYPE express tool which generates .lin linetype file automatically. But, you can make this .lin linetype file yourself and a single .lin file can contain multiple linetypes too.
In this example, I will explain all the components of linetype file with the help of a simple linetype which I created using MKLTYPE command. This is the linetype which I made.
When you open the .lin file of this linetype it will look like this.
All the characters of this file have a specific meaning. Let’s discuss all the components of this linetype file, they are marked with numbers and I am explaining these numbers here.
The new linetype starts with * sign followed with the name of linetype. In this case, the name of linetype is ATEXT
This is the description of the linetype that shows up on Linetype window, this is added after putting a comma next to the linetype name.
The A character here indicates that the construction of linetype starts from this point.
1 here indicates the length of the dashed line, this value can be anything and it will indicate the length of the dash.
-.25 is the gap length, any value followed by the negative sign indicates the gap length of linetype.
The value inside square bracket is for the text. In this case, A is the text in Standard text style and y=.1 is the offset value of text along the Y-axis (explained in the video) S=.2 is the scale of text.
Again -.4 is the gap length after the text.
1 again here indicates the length of dash line and then the whole pattern repeats itself.
Here the length of the first segment is 1 then .25 gap then “A” text in standard text style then a gap of 0.4 and again segment length of 1 and then pattern repeats.
You can copy paste same set of codes inside a single .lin file to create multiple linetypes with different text or segment lengths. One such example is this file which has three different lientypes with slightly different types of lientypes as shown in the image below.
In the example shown above, we have three different linetypes with ATEXT, BTEXT, and CTEXT as names of linetypes and slightly different properties.
Importing and exporting linetypes
There is no single command in AutoCAD with which you can export or import linetypes. Actually, you need to use a combination of different techniques to import linetypes of different types from one drawing to other.
Importing simple linetypes
Let’s start with the most basic linetypes that contain simple text and lines and which can be made using MKLTYPE command.
When you make the linetype using MKLTYPE command AutoCAD creates a .lin file which contains the data required to create the linetype. To insert this linetype type LT and press enter. Linetype manager window will open up, click on Load button and then click on File button in the next window as shown in the image below and select the .lin file and click OK.
The Load linetype window will open up with a list of linetypes available in your selected .lin file. Select all the linetypes that you want to load from this list and click OK.
You will notice that the linetypes will be loaded in the Linetype manager and now you can use them in your drawing. Simply click OK to close the linetype manager.
Note: If you are getting an error like “bad definition on line XX” then open the .lin file using notepad and check the name of text style which looks like the style name marked in the red box in the image below.
If your current drawing does not contain that text style of the same name then first create the text style with the same name and then import the linetype.
Importing linetype containing Shape
Things are little different when your linetype contains shapes. In case of simple linetype containing text all you need to worry about is the text style which should be available in the drawing where you are importing the linetype. But for linetype containing shapes you also need to ensure that shapes are available in the drawing where you are importing those linetypes.
To import the shapes you need to convert them into SHX or Shape files which can be done using COMPILE command.
You need to ensure that you already have the .lin file and the corresponding .shp file. Once you have these files, open the drawing where you want to import that linetype and type COMPILE and press enter. Select shape window will open up, select the .shp file and click on Open.
AutoCAD will automatically create the SHX file from that .shp file in the same location where your .shp file is saved. Now type LOAD and press enter, select the SHX file created in the example above and click on Open.
The shape is now loaded in the current drawing. Type SHAPE and press enter, command line will now prompt you to type the name of the Shape. Type CLT and press enter (this is shape file we created in the second linetype example above and I am using this linetype here), the shape will now follow your cursor. Click at a point in the drawing area and press enter twice to accept the default value.
This step of inserting shape in the drawing may seem unnecessary but it is quite important as AutoCAD will now recognize the shape file used in the linetype once you insert it in the drawing. You can delete the shape file after it is inserted once in your drawing.
After adding the shape file and loading the shape in your drawing you are all set to import the linetype file now. Type LT and press enter, select Load button then click on File button and load the .lin file which contains shape defined linetype.
The linetype will be added and now you can use this linetype in your current drawing. All of these methods of modifying .lin file and more has been explained in this video.
The method of making linetypes and working with them may not be very straightforward involving lots of different steps still its pretty easy once you get a hang of it.
I hope this article helped you in understanding the nuances of making, modifying and importing/exporting different type of linetypes. If you have any question related to this article let me know in the comment below and don’t forget to share this article.
Start Free Account
Start learning AutoCAD and Fusion 360 with video courses, eBooks and Q&A community
I am a mechanical engineer and I have worked with Design, Manufacturing and Training industries but now SourceCAD is my full-time work and I use it to train students all over the world. I also train corporate clients and help them develop the skill set of their workforce.
I am Autodesk AutoCAD Certified Professional and an Autodesk expert elite member. I am a regular contributor of AUGI World magazine and apart from SourceCAD I also develop AutoCAD video courses for Pluralsight and other E-Learning businesses.