|

How to Create a Custom Gas Line Linetype in AutoCAD (.LIN)

Linetype Description

This custom Gas_Line linetype is built for utility mapping, civil engineering drawings, and gas network layouts where clarity on plans is non-negotiable. It uses a continuous line interrupted by the letter “G” at consistent intervals to represent natural gas pipelines.

The use of the STANDARD text style, combined with controlled offsets, keeps the “G” readable, centered, and stable across scales. This is exactly what you want on production drawings where contractors rely on quick visual interpretation.

This type of linetype is commonly used in:

  • Utility coordination drawings
  • Infrastructure layouts
  • As-built documentation
  • Underground network plans

Step-by-Step Guide: How to Use the Code

1. Create the .LIN File

Open a basic text editor (Notepad is fine). Paste the linetype definition into a new file.

2. Save with the Correct Extension

Save the file as:

Gas_Line.lin

Make sure:

  • File type = All Files
  • Encoding = standard ANSI (default is fine)

3. Load the Linetype into AutoCAD

In AutoCAD:

  • Type LINETYPE
  • Click Load
  • Click File
  • Browse to your .lin file
  • Select GAS_LINE

Reference if needed: https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-2D0D1C79-5D1D-4A3D-B2F1-9C0F9F7E6F8A

4. Assign the Linetype

Apply it via:

  • Layer properties
  • Or directly to objects through the Properties palette

5. Adjust Linetype Scale

If the spacing or text size looks off:

  • Use LTSCALE (global scale)
  • Use CELTSCALE (object-level control)

Typical workflow:

  • Start with LTSCALE = 1
  • Adjust depending on drawing units (meters vs millimeters)

Your Selected Production Version (Final Code)

This is the version you chose for better visibility and tighter spacing. Keep it as your working standard.

*GAS_LINE,Gas Line ----G----G----G----
A, 1.0, -0.25, ["G",STANDARD,S=0.1,R=0.0,X=-0.05,Y=-0.05], -0.25

Understanding the Code (What Actually Matters on Site)

Breakdown of the key components:

  • A (Alignment) Required. Defines how the pattern starts.
  • 1.0 (Dash length) Length of the drawn segment.
  • -0.25 (Gap) Controls spacing. Smaller value = tighter repetition.
  • ["G",STANDARD,...] (Embedded Text)
    • "G" = Gas identifier
    • STANDARD = Text style used
    • S=0.1 = Text height
    • R=0.0 = Rotation
    • X, Y = Offset tuning
  • Final -0.25 Controls spacing before the pattern repeats

This setup gives you a compact, readable, and clean linetype that works well in dense utility drawings.


Optimizing for CAD Standards and Real-World Use

Text Style Setup

Your STANDARD text style must have height = 0.

If not:

  • AutoCAD will ignore your S=0.1
  • Your “G” size will behave inconsistently

Check it with:

STYLE

You’re currently using:

R=0.0

In production, consider switching to:

U=0.0

Why:

  • Keeps the “G” upright regardless of line direction
  • Prevents upside-down text in rotated viewports
  • Standard practice on large infrastructure projects

Scaling Strategy (Avoid Common Mistakes)

If you’re working in:

  • Meters → Your current values are fine
  • Millimeters → You may need to increase scale (e.g., LTSCALE = 100)

Always test:

  • In Model Space
  • In Layout with viewport scaling

Layer Management Best Practice

Do not assign this linetype randomly.

Create a dedicated layer:

GAS-NETWORK

Then:

  • Assign color
  • Assign linetype
  • Control visibility globally

This avoids cleanup issues later.


Performance Considerations

Heavy use of text-based linetypes can slow down:

  • Large drawings
  • Xrefs with many polylines

Recommendations:

  • Use selectively (main network lines only)
  • Avoid on dense hatch boundaries or complex polylines

Common Problems and Fixes

Text not showing

  • Check LTSCALE
  • Check annotation scale
  • Ensure text style height = 0

Text too small or too large

  • Adjust S=0.1 in the code
  • Reload the linetype after editing

Linetype appears continuous

  • Run:
REGEN
  • Check:
PSLTSCALE = 1
MSLTSCALE = 1

Reference: https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-8D2C9F0E-0B91-4D4E-9E6E-5A2B9E0C7F3A


FAQ

Can I replace “G” with another symbol?

Yes. Replace "G" with:

  • "W" for water
  • "E" for الكهرباء (electric)
  • Or any character supported by your font

Can I use a custom font instead of STANDARD?

Yes, but:

  • The font must be loaded in AutoCAD
  • Avoid decorative fonts in technical drawings

Why is my linetype not scaling correctly in layouts?

Check:

  • PSLTSCALE = 1
  • Viewport scale consistency
  • Annotation scale conflicts

Can I add circles or shapes around the “G”?

Not directly in .LIN. You’d need:

  • A complex linetype with SHX shapes
  • Or switch to blocks + annotation workflow

Is this suitable for BIM or Civil 3D workflows?

Yes, for 2D documentation layers. For full BIM workflows:

  • Use object styles + labels instead of linetypes

Do I need to reload the linetype after editing the .LIN file?

Yes. Always:

  • Use LINETYPE → Reload
  • Or restart AutoCAD if it doesn’t update

This setup is solid for production. If you need a version with double lines, offset pipelines, or pressure class annotations, build on this base rather than starting over.