Line styles in TBC can be imported as several different formats, including:
- .ltp (TGO Linestyle Library)
- .linestyle (Trimble Line style file)
- .lin (Autodesk Line type file)
The .ltp and .linestyle formats are limited in what the user can produce. This document will outline the creation of .lin files as more intricate line styles can be created using this formatting.
Line styles in .lin format have three different types, basic broken line with gaps at specified distances, line style with text and line style referencing a shape file. Note a licence for Autodesk or Civil3D is required to create the shape files, this document will not detail how to create shape files, please see the below video for more information on creating shapefiles and line types in Autodesk/Civil 3D.
How to create custom line types in AutoCAD Civil 3D
Creating a .lin file
Below explores how a .lin file is created and formatted:
- Start by opening a blank Notepad file.
- Give the file a name, version number and date the file was last modified. Include any other text or notes about the file. See example below.
Note: double “;” is used to specify that text line is not to be read by the program as a line style.
Creating basic line styles
Basic line styles consist of a line with gaps or breaks at specific distances for example a dashed line like the one below.
To create a line like the example above:
- On a new text line use * to specify the name of the line style e.g. *ET. If you wish, use a dash “-“ to draw a line to give a visual example of how the line will look when imported (this does not have to be accurate).
- On the text line below input “A,1,-1”, see below
-
More intricate line styles can be created using this method see the below examples:
Creating line styles with text
Lines with text can also be created and is like creating a basic line style like described above. See below example.
- Follow step 1 above giving the line style a name and creating a visual example of the line if required.
- On the text line below input “A,4,-0.5,["SM",DPTI,S=0.5,R=0,X=-0.28,Y=-0.2],-0.5”, see below.
A .labelstyle file needs to be created and put in the same folder as the .lin file. See the above example, the code is referencing the DPTI .labelstyle file, if this file is not in the same folder as the .lin file, TBC or FDM will not recognise the .lin file and will produce an error message.
To export a .labelstyle file navigate to Draughting → Labels → Label Style Manager. Create a text style (note at this time the text style does not matter the text style in the line style will be the default) then export the .labelstyle.
The scale and rotation of the text can be easily changed. The best method to get the correct scale and rotation is through trial and error.
The offset values specify the offset of the text. The origin where X = 0 and Y = 0 is to the bottom left corner of the text, see below. A negative X value places the text to the left of the origin and a negative Y value places the text below the origin. Trial and error is again the best way to get the desired offset of the text.
Creating line styles shape objects
Creating a line style that references a shape file is again like the methods described above. More intricate line styles can be created using this method. The method below can only be used after the reference shape files have been created. This workflow assumes the shape files have already been created and compiled from Autodesk. See the below example:
- Follow step 1 above giving the line style a name.
- On the text line below input “A,0.5,-0.25,[DT,DPTI_All.shx,s=1.67],-0.25,0.5,-0.5,0.5,-0.5,0.5,-0.5”, see below.
A compiled shape file (.shx) needs to be referenced to create line styles with shapes in them. The .shx file also needs to be in the same folder as the .lin folder, otherwise TBC and FDM will not recognise the .lin file and produce an error message.
In the above example the shape being referenced is named “DT”. The exact name of the shape must match otherwise the program will not recognise it. The shape file being referenced (DPTI_ALL.shx), again the name must match exactly. Therefore, for this example the program looks for the shape named “DT” located in the “DPTI_ALL.shx” file.
The scale of the shape is again best calculated by trial and error.
Before importing the line styles into TBC or FDM ensure the .labelstyle and .shx file are both in the same folder as the .lin file, see below.
See the below examples of more line styles referencing shape files:
Importing .lin files into TBC
Now the .lin file has been created the line styles can be imported into TBC. To import the line styles into TBC:
- Start by importing the .labelstyle file into TBC. Navigate to Draughting → Labels → Label Style Manager.
- Click Import in the bottom right corner of the window. Select the .labelstyle file you wish to import and click Open. Click OK closing the Label Style Manager window.
- Navigate to Draughting → Draughting Elements → Line Style Manager.
- Set the Length unit and Unit reference.
- Click the button and navigate to the folder containing the .lin, .labelstyle and .shx file. Select the .lin file and click Open.
- Select the line styles you wish to import and click . Alternatively click to import all the line styles.
- Once the line styles you wish to import are in the left-hand column, click OK to import them.
The line styles should now be in your TBC project. To see how to import .lin line styles into the Feature Definition manager see HERE.