What's in YOUR Acad.lsp file??

by Paul Jordan
(Vancouver, WA)

I've been working on mine for over 20 years. Some of the commands were project specific, some I use all the time. I basically keep my left hand on the keyboard and my right hand on the mouse.. I've also got a Nostromo N52 Gamers keypad that I've added a ton of commands to. If you have a chance, look at this bad boy on their website.

Anyhow, I figured the easiest way to share my lisp commands is to post the text from my acad.lsp file.. So, here goes: Whoah... WWait a minute.. That file is 26k in size..

Well, if anyone wants to give it a shot, drop me a message. I'm still new here so I don't know if you can email me straight from this site or not.

Don't worry, the files is 100% safe as it's all simple text with some AutoCad functions in it...

Here's an example.. This routine will make an AS-Built layer and allow you to type text right on that layer..

(defun c:abh ()
(setq cl (getvar "clayer") ;current layer
cc (getvar "cecolor") ;current color
tln (cdr (assoc 8 el)) ;text layer name
tc (cdr (assoc 62 el)) ;text color
)
(command "LAYER" "M" "as-built" "")
(print "Enter location of text and start typing: ")
(print)
(command "DTEXT" pause "0")
(if (/= cl tln)(command "LAYER" "S" cl ""))
(if (/= cc tc)(command "COLOR" cc))
;else
(setq cl nil cc nil)
(setq tc nil tln nil)
(princ)
)

OK, another quick example:

(defun C:1X()
(command "OFFSET" "3/4")
)
(defun C:2X()
(command "OFFSET" "1-1/2")
)
(defun C:4X()
(command "OFFSET" "3-1/2")
)
(clock)
(defun C:6X()
(command "OFFSET" "5-1/2")
)
(defun C:8X()
(command "OFFSET" "7-1/4")
)
(defun C:10X()
(command "OFFSET" "9-1/4")
)
(defun C:12X()
(command "OFFSET" "11-1/4")
)


Now what the heck do all those do?? Well, I got tired of typing in Offset 3-1/2" to make a 2x4 (the "4" side so I made it 4x.

These are simple and most of the routines can be figured out with just a little bit of knowledge of lisp.

Let me know if you have any questions.

Click here to post comments

Join in and write your own page! It's easy to do. How? Simply click here to return to AutoCAD Tips.


Sign up for our FREE CAD Tips and Tricks Newsletter:
"The CAD Times"

Enter Your E-mail Address
Enter Your First Name (optional)
Then

Don't worry — your e-mail address is totally secure.
I promise to use it only to send you "The CAD Times".

Enjoy this page? Here's another way to pay it forward...

Would you prefer to share this page with others by linking to it?

  1. Click on the HTML link code below.
  2. Copy and paste it, adding a note of your own, into your blog, a Web page, forums, a blog comment, your Facebook account, or anywhere that someone would find this page valuable.

Join "The CAD Times"  Newsletter Along With 5,000 Subscribers

Enter Your E-mail Address
Enter Your First Name (optional)
Then

Don't worry — your e-mail address is totally secure.
I promise to use it only to send you "The CAD Times".



Recent Articles

  1. What is AutoCAD Used For?

    Jan 27, 23 07:50 PM

    If you ever wondered what is AutoCAD used for, read on...

    Read More

  2. Viewport turns black

    Oct 29, 21 09:34 AM

    I was giving a dog file to work on, and when I try to insert a north arrow into layout viewport, the viewport turn black when I move my cursor into the

    Read More

  3. Converting .pdf's to .dwgs

    Oct 29, 21 09:31 AM

    I get a LOT of plans from clients where they used some cad program that will only create .pdf files or they found a plan on a site and it came to them

    Read More