Monday, May 25, 2020

Fast AutoCAD project custom text linetypes on the fly

A simple instantaneous linetype reloading system is a huge relief when you want AutoCAD custom text complex linetypes that say things like 400mm W or 1 1/2" GAS (PE). Here is a system that disrupts you minimally so you can get back to your project design.
1. The "system" consists of a file called "Project-Linetypes.lin". You put the file in the same directory as your drawing.
2. There's a bit of AutoLISP code at the top of the file you copy and paste into your AutoCAD command line. It creates the LPL command so you can type LPL to load and reload your linetypes instantly.
3. There are many examples of custom linetypes in the file.
4. Type LPL and REGEN to redefine the linetypes after editing.
Watch the 5-minute video

To get started, right-click and save this file to your drawing's folder. Here are the contents of the file:


;; Project Complex linetypes for utilities
;; By Tom Haws 2020-05-25
;; The following LISP function will create a command to 
;; quickly reload this file for a quick linetype development cycle.
;; Run it, then cancel the command and regen.
;;(DEFUN c:lpl ( / EOLD)(SETQ EOLD (GETVAR "EXPERT"))(if (not (findfile "Project-linetypes.lin"))(alert "Error: Can't find Project-linetypes.lin file."))(SETVAR "EXPERT" 5)(COMMAND "._LINETYPE" "_LOAD" "*" "acad.lin" "")(COMMAND "._LINETYPE" "_LOAD" "*" "Project-linetypes.lin" "")(SETVAR "EXPERT" EOLD)(PRINC))
*UTIL_CTV,CTV repeated every 1.5 inch
*UTIL_E,E repeated every 1.5 inch
*UTIL_G_1_2,1/2" G repeated every 1.5 inch
*UTIL_G_2, repeated every 1.5 inch
*UTIL_G_UNK,G? repeated every 1.5 inch
*UTIL_S,S repeated every 1.5 inch
*UTIL_T,T repeated every 1.5 inch
*UTIL_WS,WS repeated every 1.5 inch
*UTIL_W_3_4,3/4" (TYPE K COPPER) repeated every 8 inches
A,5.2,-1.4,["3/4%%34W (TYPE K COPPER)",STANDARD,S=.125,R=0.0,X=-1.2,Y=-.05],-1.4
*UTIL_W_6,6"W repeated every 1.5 inch
*UTIL_W_12,12"W repeated every 1.5 inch
*UTIL_S_8,8"S repeated every 1.5 inch

No comments: