My ACAD.LSP file
My ACAD.LSP file
2
Sparweb (Aerospace)
(OP)
I felt like sharing today.
AutoCAD is designed to be used with a keyboard. Users who don't maximize their use of a keyboard are not maximizing their efficiency in AutoCAD.
Here is an explanation of the keyboard shortcuts I like:
I make multi-sheet drawings. Saved views allow me to switch easily from one sheet to another. VRA jumps to sheet A, no matter where I started from.
I dodn't always have a scroll wheel mouse, eg Laptop trackpad. ZI and ZO allow quick zooming in without selecing windows over and over.
I still frequently use ZE to see EVERYTHING - and find all the stuff people drew 6 miles to the left of the main view.
Breaking lines takes a lot of clicks. BRA saves clicks.
Many users don't configure units, and I may open their drawing to find either 10 decimal places, or none. U1 through U5 saves many clicks.
Making Circles requires more clicks than necessary.
I don't do Filleting without trimming very often, but when I do I want to switch back and forth frequently during the process, so this helps.
Construction lines are valuable so I shortened the typing to have horizontal and vertical XLINES.
Making drawings inevitably means bringing in blocks, styles, and "stuff" you don't need when you're done. Purgall in one command dumps all the chaff.
How often do you want a copy of a line rotated 90 degrees? Do both steps in one CORO.
Did you create a block file, but set its base in the wrong spot? BAM and you're done. It even resizes the view to fit the preview.
CODE --> LISP
; Extra commands for AutoCAD ; Steven Fahey ; 7 JANUARY 2015 ; (defun c:VRA () (command "view" "r" "A")) (defun c:VRB () (command "view" "r" "B")) (defun c:VRC () (command "view" "r" "C")) (defun c:VRD () (command "view" "r" "D")) (defun c:VRE () (command "view" "r" "E")) (defun c:VRF () (command "view" "r" "F")) (defun c:VSA () (command "view" "s" "A")) (defun c:VSB () (command "view" "s" "B")) (defun c:VSC () (command "view" "s" "C")) (defun c:VSD () (command "view" "s" "D")) (defun c:VSE () (command "view" "s" "E")) (defun c:VSF () (command "view" "s" "F")) (defun c:ZA () (command "zoom" "all")) (defun c:ZE () (command "zoom" "e")) (defun c:ZP () (command "zoom" "previous")) (defun c:ZI () (command "zoom" "2x")) (defun c:ZO () (command "zoom" ".8x")) (defun c:ZOO () (command "zoom" ".5x")) (defun c:Z1P () (command "zoom" "1xp")) (defun c:BRA () (command "break" pause "f" "int" pause "@")) (defun c:U1 () (command "luprec" "1")) (defun c:U2 () (command "luprec" "2")) (defun c:U3 () (command "luprec" "3")) (defun c:U4 () (command "luprec" "4")) (defun c:U5 () (command "luprec" "5")) (defun c:cttr () (command "circle" "ttr" "tan" pause "tan")) (defun c:c3p () (command "circle" "3p")) (defun c:c2p () (command "circle" "2p")) (defun c:filt () (command "fillet" "trim" "t")) (defun c:filn () (command "fillet" "trim" "n")) (defun c:xv () (command "xline" "v")) (defun c:xh () (command "xline" "h")) (defun c:purgall () (command "purge" "a" "" "n")) (defun c:coro () (command "copy" pause "" "0,0" "@" "rotate" "p" "" pause "90")) (defun c:bam () (command "base" "0,0,0" "move" "all" "" pause "0,0,0" "zoom" "e" "zoom" "0.75x"))
AutoCAD is designed to be used with a keyboard. Users who don't maximize their use of a keyboard are not maximizing their efficiency in AutoCAD.
Here is an explanation of the keyboard shortcuts I like:
I make multi-sheet drawings. Saved views allow me to switch easily from one sheet to another. VRA jumps to sheet A, no matter where I started from.
I dodn't always have a scroll wheel mouse, eg Laptop trackpad. ZI and ZO allow quick zooming in without selecing windows over and over.
I still frequently use ZE to see EVERYTHING - and find all the stuff people drew 6 miles to the left of the main view.
Breaking lines takes a lot of clicks. BRA saves clicks.
Many users don't configure units, and I may open their drawing to find either 10 decimal places, or none. U1 through U5 saves many clicks.
Making Circles requires more clicks than necessary.
I don't do Filleting without trimming very often, but when I do I want to switch back and forth frequently during the process, so this helps.
Construction lines are valuable so I shortened the typing to have horizontal and vertical XLINES.
Making drawings inevitably means bringing in blocks, styles, and "stuff" you don't need when you're done. Purgall in one command dumps all the chaff.
How often do you want a copy of a line rotated 90 degrees? Do both steps in one CORO.
Did you create a block file, but set its base in the wrong spot? BAM and you're done. It even resizes the view to fit the preview.
STF
RE: My ACAD.LSP file
Dik
RE: My ACAD.LSP file
Hopefully others will share, too....
STF
RE: My ACAD.LSP file
Dik
RE: My ACAD.LSP file
Some time ago I had really big library of additional Autocad functions in Lisp. But with every new Autocad version came new functions together. So some Lisp text were going to oblivion.
Still using several Lisp commands saved in my acad.lsp
Often I need to break element from first point like SparWeb has (BRA):
(defun c:BRF()
(command "BREAK" pause "F" (setq f_point (getpoint)) f_point)
(princ)
)
Sometimes draw a line between to arcs from tangent to tangent:
(defun c:LTT ()
(command "line" "tan" pause "tan" pause "")
)
Occasionally I draw a circles with given arc length:
(defun c:CBL()
(setq cp (getpoint "\nCenter of the circle: ")
cl (getdist "\nLength of the cirle: ")
)
(setq rad (/ cl (* pi 2)))
(command "CIRCLE" cp rad)
)
Sometimes I have to measure distance in XY plane with Z distance ignored:
(defun c:DIXY ( / fPoint sPoint XYDist)
(setq fPoint (getpoint "\nSelect the first point of XY distance: ")
sPoint (getpoint fPoint "\nSelect the second point of XY distance: ")
XYDist (distance (list (car fPoint) (cadr fPoint) 0.0) (list (car sPoint) (cadr sPoint) 0.0))
)
(princ (strcat "\n\nDISTANCE on XY plane = " (rtos XYDist)))
(princ)
)
RE: My ACAD.LSP file
STF
RE: My ACAD.LSP file
[Added] forgot to mention file name for Bricscad is On_Start.lsp, your CAD program may use something other than acad.lsp. Check the directory that your CAD app is installed in and do a search for *.lsp. You may be able to determine which one loads.
Dik
RE: My ACAD.LSP file
In some ways, this is inevitable when AutoCAD remains essentially the same tool, and other tools become so capable at doing similar or competing things.
So IMO it's just AutoCAD standing still while the others run ahead.
On the other hand, Autodesk's attempts to make AutoCAD more "user-friendly" have severely affected a user's ability to learn and appreciate all of its capabilities. Many of my co-workers have AutoCAD but know nothing of its abilities. They say it "can't be done" or "that's really hard" when I know I can do it in a snap in AutoCAD. ISO views, tracing photographs and fastener patterns from paper rubbings, and so much more. 3D parametric CAD can't do that. I have accepted that from now on, people who think they can't do such things will be the norm, and that their biggest obstacle will be looking down their noses at AutoCAD. Knowing what they refuse to know gives me a competitive advantage over my co-workers, so I won't shed a tear as they disappear behind me.
STF
RE: My ACAD.LSP file
Autocad still always by my hand, just time I spend with it become shorten.
RE: My ACAD.LSP file
Although some time ago I tried to find my ACAD.LSP file without success, I appreciate what you shared
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
Download and install "Everything" from VoidTools.com
RE: My ACAD.LSP file
(DEFUN C:DAS () (COMMAND "DIMREASSOCIATE"))
(DEFUN C:MT () ; MText on layer TEXT
(setq CLA (getvar "CLayer"))
(progn
(setvar "CLayer" "TEXT")
(command "MTEXT" pause "J" "bl" pause)
(setvar "Clayer" CLA)
)
(PRINC)
)
etc etc etc
RE: My ACAD.LSP file
Thanks for the advice. I've tried and still can not find "ACAD.LSP". Is it possible that it does not exist in my PC?
Thank you!
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
(DEFUN S::Startup ()
; (command "insert" "title=title" "y" "0,0" "1" "1" "0" "" "" "" "" "" "" "" "")
; (command "zoom" "e")
; (command "erase" "l" "")
; (command "layer" "freeze" "rev*" "")
(setvar "modemacro"
(strcat
"$(getvar,clayer)"
"$(getvar,dimstyle)"
"$(if,$(getvar,orthomode), ORTHO)"
"$(if,$(=,$(getvar,osmode),0), NON)"
"$(if,$(=,$(getvar,osmode),1), END)"
"$(if,$(=,$(getvar,osmode),2), MID)"
"$(if,$(=,$(getvar,osmode),4), CEN)"
"$(if,$(=,$(getvar,osmode),8), NOD)"
"$(if,$(=,$(getvar,osmode),16), QUA)"
"$(if,$(=,$(getvar,osmode),32), INT)"
"$(if,$(=,$(getvar,osmode),64), INS)"
"$(if,$(=,$(getvar,osmode),128), PER)"
"$(if,$(=,$(getvar,osmode),256), TAN)"
; "$(getvar,dwgname)"
)
)
(princ)
)
RE: My ACAD.LSP file
Put it in your support file path
RE: My ACAD.LSP file
Mine is called acad2014.lsp
There is also another file called acad2014doc.lsp that is full of commands; I think I just need to edit acad2014.lsp, am I right?
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
Way back when... I did a search of my C: drive (OS and application drive)... it's actually a M.2 drive, and did a search for *.lsp files... Bricscad uses a startup file called on_start.lsp and not acad.lsp that it loads first. You may have a similar equivalent file.
In an earlier posting I noted that I upgraded to include a couple of the lisp files and forgot to mention that it was a different file name than acad.lsp, I just did it without thinking about it; I updated the on_start.lsp and should have mentioned it was a filename different than acad.lsp.
Dik
RE: My ACAD.LSP file
Another really good addition equivalent to Notepad on steroids... Notepad ++ Look it up, you'll like it.
Dik
RE: My ACAD.LSP file
I don't think the files you found are the right ones... hard to tell. You haven't told us what version of the software you have.
Over the years, and depending on the version of AutoCAD and maybe also system OS and user/administrator setup, Autodesk installs AutoCAD in slightly different ways. It takes some hunting. Here are the places where I have found my Support path:
(years ago) C:\Users\Rigel\AppData\Roaming\Autodesk\AutoCAD 2009\R17.2\enu\Support
(recently) C:\Program Files\Autodesk\AutoCAD 2017\Support
You will find a basic "acad.lsp" there. You can add new LISP routines in the file by editing with a text editor like Notepad (Notepad++ is better).
I have kept my own personal .LSP file (and .PGP, .LIN files, too) in a separate location so that I can reinstall them every year I upgrade.
STF
RE: My ACAD.LSP file
I am using Autocad 2014 and I found acad2014.lsp on C:\Appls\Autodesk\AutoCAD 2014\Support
This is what it got:
CODE -->
Regards
RE: My ACAD.LSP file
RE: My ACAD.LSP file
STF
RE: My ACAD.LSP file
What am I doing wrong?
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
I've got a bunch of different long lisps in different files (each file, a long command)
Do you think I should "merge" everything on a really long and messy ACAD.LSP or there is a more orderly way of doing it?
I have all my lisps files on my documents folder
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
Before executing (MT) your have to create layer named "TEXT":
Manually in the current drawing.
Manually but once in your drawing template,
or some additional Lisp code where the "TEXT" Layer have to be created if not exists.
Try to put this:
CODE -->
To the second question:
In your acad.lsp your could to write:
CODE -->
Also there in Autocad Options is Startup Suite, where you can set any Lisp file to start in every session.
RE: My ACAD.LSP file
RE: My ACAD.LSP file
(DEFUN C:Cutube () (IF (NOT C:Cutube) (LOAD "Cutube")) (C:Cutube) (PRINC))
RE: My ACAD.LSP file
Thank you for both codes! I really appreciate your help since I'm really noob to ACAD Lisps.
The second code (autoloading lisps) works perfect (using / instead of \), but something went wrong with your MT lisp. This is what I got when I write "MT" on command line:
¿Any ideas? Thank you!
CODE --> error
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
(command "-layer" "m" "TEXT" "c" "80" "" "L" "continuous" "")
to
(command "-layer" "m" "TEXT" "c" "80" "" "L" "continuous" "" "")
RE: My ACAD.LSP file
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
RE: My ACAD.LSP file
Dik
RE: My ACAD.LSP file
Yes, I want to start learning to program in lisp but I am currently short on free time. When I start programming, I'll probably come back with more questions! ;)
JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
RE: My ACAD.LSP file
Old threads tend to get locked after a period of inactivity, so don't hesitate to start a new one to expand this topic.
STF
RE: My ACAD.LSP file
Dik
RE: My ACAD.LSP file
I've been thinking about sharing a number of things to help user configuration of AutoCAD. The LISP file was the obvious starting point.
Given the interest in this thread, I now want to create more new threads about other user configuration details, such as "Workspace", desktop link switches, keyboard shortcuts in the PGP file, etc.
I find that users new and old are presented with the default workspace of AutoCAD and are either overwhelmed by the mess or offended by the clutter. (I'm the latter).
There's a dramatic difference between the user experience of AutoCAD (keyboard+mouse) compared to nearly every other professional software interface (mouse exclusively).
I guess I'm wandering into "user interface" issues... probably worth a thread of its own, too.
STF
RE: My ACAD.LSP file
They only use AutoCAD LT.
LT doesn't accept LISP.
BOOHOOO
STF
RE: My ACAD.LSP file
has 4 or 5 programming environments as well as Lisp, and does 3D. I've opened 50 meg 3D
files from Autocad using Bricscad, modified them and reopened them with AutoCAD.
You also buy a license, not rent one.
Wordwrap doesn't seem to be working... Put in 'hard' breaks.
Dik
RE: My ACAD.LSP file
Unfortunately, the PC's are all "locked down" and I do not have ADMIN privileges, either!
I can't even delete the "bloatware" icons on my desktop!
STF
RE: My ACAD.LSP file
I can be working on it before the login screen comes up on the office
desktop. I'm not a cad operator, but, use it and often provide details
for normal CAD operators. I also have thousands of standard details that
I use for projects.
You may want to talk to management about changing... if you need to provide
a client with an 'official' autocad drawing, then have one dedicated work
station for this. Look into Bricscad, you could save your company several
thousand dollars. I know how difficult it is... I tried approaching our
company for the same reason.
Dik
RE: My ACAD.LSP file
STF
RE: My ACAD.LSP file
Dik
RE: My ACAD.LSP file
STF
RE: My ACAD.LSP file