AutoCAD has it's own library of linetypes which is quite sufficient for most of the common drawings.
Still, if you are wondering how to make custom linetypes in AutoCAD then this article will help you with that.
Just like linetypes you can also make custom hatch patterns in AutoCAD but here we will stick with linetypes only.
Before we start if you prefer a video then here is the video version of this article.
Making Linetype with text and symbol
Let’s assume that we want a custom linetype containing repeating patterns of text and symbols as shown in the image below.
In this case, the arrows are used from the character map (Symbol library of Windows operating system) 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 the “Other” option from the Symbol tool of the “Insert” panel on the “Text Editor” tab as shown in the following image.
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 symbols make two lines of equal length as shown in 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, this is an important step and without exploding the next commands won’t work.
70 lessons| Easy Level
If you are absolute beginner of AutoCAD then you can get started right from scratch using this free course.
Select the text as well as arrow symbols then type X and press enter.
By doing so we have converted the 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 the desktop as the location and naming it as Sample_Ltype.
The linetype will be saved with the .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 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.
To do that select the rectangle and circle and then right-click and select properties from the context menu.
Now from the Linetype scale option select a scale you want and the scale of the selected linetype will change.
Making linetypes with complex shapes
In this case, I will show you the method of making a linetype with a complex shape containing an arc as well as a line as shown in the image below.
Now, in this case, we are using an arc which MKLTYPE command won’t recognize and hence we need to convert this complete linetype segment into a “shape” which MKLTYPE command recognizes.
Start by making the two slot shapes as shown in the image above using line and arc commands.
If you are using polyline to make the shape then make sure you explode it after making it, as polyline can’t be used for making linetypes.
Now, to make the Shape file type MKSHAPE and press enter, the “select the 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 the name “Complex_Shape”.
The shape will be saved with the 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 the shape which you want to insert, type CLT and press enter again.
The cursor will now have the shape, click on the midpoint of the left line again as marked in the red circle in the image above.
This will overlap the shape over the existing geometry.
On the next prompts of height and rotation angle simply press the enter key to accept the default values and exit the command.
70 lessons| Easy Level
If you are absolute beginner of AutoCAD then you can get started right from scratch using this free course.
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 the 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 the CLINE name is now added and loaded in the drawing.
Now make a circle and a line and then apply this newly created linetype.
After applying the new linetype it looked like this on my drawing.
So, that’s the step-by-step method of making a custom linetype using complex shapes in AutoCAD.
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 the * sign followed by 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 the 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 the 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 the pattern repeats.
You can copy-paste the 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 another.
Importing simple linetypes
Let’s start with the most basic linetypes that contain simple text and lines and which can be made using the 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 the Load button and then click on the 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 a little different when your linetype contains shapes.
In the case of a 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 the 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.
70 lessons| Easy Level
If you are absolute beginner of AutoCAD then you can get started right from scratch using this free course.
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 the Load button then click on the File button and load the .lin file which contains the 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 files and more have been explained in this video.
Exporting custom linetype
If you have a drawing containing completely new linetype and you don’t have its linetype file then there is a VLX file courtesy of Cadstudio.cz that can make exporting linetype from your drawing a seamless task.
Download the LinOut.vlx here.
Once you have that file type APPLOAD on the command line and press enter.
This will open Load/Unload Applications window, locate the file location from Look In dropdown menu select LinOut.vlx file and click on load button.
When the file is loaded Click on the close button.
Now type LINOUT on the command line and press enter, a new linetypes.lin file will be added to the same folder in which your current drawing is stored.
This lin file will contain all custom linetypes of your current drawing.
Summary
The method of making linetypes and working with them may not be very straightforward involving lots of different steps still it’s 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 types of linetypes.
If you have any questions related to this article let me know in the comment below.