AutoCAD Line Type Builder
A web-based tool for creating custom .lin files for AutoCAD line types. Build line patterns using drag-and-drop design cards with dashes, dots, and text elements.
Features
- Visual Design Interface: Create line types using design cards
- Real-time Preview: Live, theme-aware canvas preview with Light/Dark modes
- Multiple Element Types: Support for dashes, dots, and text elements
- AutoCAD Compatible: Generates proper .lin file format
- Export Options: Copy code or download .lin files
- Responsive Design: Works on desktop, tablet, and mobile devices
Project Structure
autocad-linetype-builder/
├── index.html # Main application interface
├── css/
│ └── style.css # Application styling
├── js/
│ └── script.js # Line type builder logic
├── data/
│ ├── presets.json # Sample presets
│ └── symbols.json # Symbol list for text elements
├── robots.txt # SEO robots directives
├── sitemap.xml # SEO sitemap
├── google...html # Google site verification file
├── vercel.json # Hosting config (optional)
├── package.json # Project dependencies
└── README.md # Project documentationHow to Use
-
Enter Line Type Information
- Provide a name for your line type (max 31 characters)
- Add a description explaining the line type's purpose
-
Add Design Elements
- Click "+ Add Element" to add dashes, dots, or text
- Each element can be customized individually
- Remove elements using the × button on each card
-
Generate and Export
- View the generated .lin code in real-time
- Copy the code to clipboard
- Download as a .lin file for use in AutoCAD
Theming
- Toggle Light/Dark in the footer; default is Light
- The preview grid and content adapt to the selected theme instantly
Element Types
Dash
- Positive values create visible line segments
- Negative values create gaps/spaces
- Length determines the size of the dash or gap
Dot
- Always has a length of 0
- Creates a point marker in the line pattern
- Useful for center lines and detail marks
Text
- Embeds text strings within the line pattern
- Configurable rotation (Upright, Relative, Absolute)
- Adjustable scale, position offsets
- Uses STANDARD text style by default
Getting Started
Prerequisites
- Node.js (optional, for development server)
- Modern web browser
- AutoCAD (to use generated .lin files)
Installation
- Clone or download this project
- Open the project folder in VS Code
- Install dependencies (optional):
npm install
Running the Application
Option 1: Using Live Server (Recommended)
npm startThis will start a development server at http://127.0.0.1:8080 (or http://localhost:8080)
Option 2: Using npm dev server
npm run devThis will start a development server at http://127.0.0.1:3000
Option 3: Direct File Opening
Simply open index.html in your web browser by double-clicking the file.
AutoCAD .lin File Format
The generated files follow AutoCAD's linetype definition format:
*LINETYPE_NAME,Description text
A,length1,length2,length3,...- First line: Asterisk + name + comma + description
- Second line: "A" + comma + pattern values
- Positive numbers = visible dashes
- Negative numbers = gaps
- Zero = dots
- Text elements = ["text","style",scale,rotation,x,y]
Browser Support
This website supports all modern browsers including:
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
Contributing
- Fork the project
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This project is licensed under the MIT License - see the package.json file for details.
Development Notes
- Uses modern CSS Grid and Flexbox for layouts
- Canvas-based preview renders grid and pattern each frame and on theme/resize changes
- Mobile-first responsive design approach
- Follows web accessibility best practices