LINEWEIGHT & LWDEFAULT (ACAD 2011)

LINEWEIGHT & LWDEFAULT (ACAD 2011)

Anonymous
Not applicable
947 Views
3 Replies
Message 1 of 4

LINEWEIGHT & LWDEFAULT (ACAD 2011)

Anonymous
Not applicable

I need to have a LINEWEIGHT of .000" to work with our Epilog Laser system.  To perform a laser job, I have to open the drawing and manually set the LINEWEIGHT to .000".

 

I've manually set the LINEWEIGHT to .000" and saved the drawing as ACAD.DWT and closed ACAD.  When I re-open ACAD the LINEWEIGHT has defaulted back to .010".  I then looked in SETVAR and found the LWDEFAULT command (which is not a "READ ONLY" variable).  LWDEFAULT has a default value of 25.  I changed the default value from 25 to 0 and again saved the drawing as ACAD.DWT and closed ACAD.  Re-opening ACAD the LINEWEUGHT is back to .010" and the LWDEFAULT is back to 25.

 

It is/was my understanding that if a SETVAR variable is not a "READ ONLY" you could change the value and save the file as ACAD.DWT and the SETVAR variables would be altered to my desires.  What can I do?

0 Likes
948 Views
3 Replies
Replies (3)
Message 2 of 4

pendean
Community Legend
Community Legend

"re-open acad" dean't necessarily mean your custom ACAD.DWT is being use by default. Look up QNEW in Help, I think that's what you want.

Any reason you can't place these variables (and any others you prefer) in a custom ACADDOC.LSP that will always, always, kick in at any file startup and set these for you all the time with any file you open?
Here are some tutorials to get you started:
http://www.cad-notes.com/set-default-system-variables-in-acaddoc-lsp/
http://jtbworld.com/acaddoc-lsp
http://howtoautocad.com/how-to-use-acad-lsp-and-acaddoc-lsp/

0 Likes
Message 3 of 4

Anonymous
Not applicable

Dean,

 

Unfortunately I cannot access the links you provided (very limited internet access (big brother is always watching) here at work).  Can you offer any guidance within this forum?

0 Likes
Message 4 of 4

pendean
Community Legend
Community Legend
Here is the text from one of the links: I'm sure you can go to your local library or link to the others from home if needed:

How to use acad.lsp and acaddoc.lsp
by WILL on OCTOBER 19, 2011
Lisp is a very useful part of the AutoCAD® application, and one of the first things its good for you to know is how acad.lsp and acaddoc.lsp work. These two lisp files are automatically executed when certain conditions occur in AutoCAD.

acad.lsp

Firstly, acad.lsp is by default executed when AutoCAD® first boots up. Therefore, this will run once only. Because of this it is a great place to put startup procedures, or things that you want to do to initialise AutoCAD®. For example, I have mapped commands to various key combinations under my left hand, including SS, DD and DA. The problem is, these are existing built in commands to AutoCAD®. The solution for me was to use the UNDEFINE command to remove the default commands from AutoCAD®, which would then allow my own customisations in acad.pgp to take priority. And acad.lsp is a great place to run these commands, like so:

(command “undefine” “ss”)
(command “undefine” “dd”)
(command “undefine” “ad”)

For those new to lisp, the lisp command at work here is “command”, which basically allows you to invoke any AutoCAD® command from lisp. The text provided in quotes will be executed as if you had entered them into the AutoCAD® command line.

acaddoc.lsp

So how does acaddoc.lsp differ? As the name suggests, this has something to do with documents. In fact this lisp file is run every time a document is opened. Therefore this is the perfect place to do anything that is specific to the drawing you are working on. For example, I have a few system variables that I like to be set a certain way. Annoyingly they are drawing specific, but using acaddoc.lsp we can set them to whatever we want when the drawing is opened:

; SKETCH produces polylines
(setvar “SKPOLY” 1)
; suppress “Would you like to convert to a polyline prompt”
(setvar “PEDITACCEPT” 1)
; set linetypes to be continuous on polylines
(setvar “PLINEGEN” 1)

Here are a few. For those learning lisp, the”setvar” lisp command tells AutoCAD® to set the value of a system variable (pretty obvious really!). Again, the arguments passed to it will have to correspond with how you’d enter them into the command line normally.

Where to save acad.lsp and acaddoc.lsp

The location of where to save acad.lsp or acaddoc.lsp depends on what you want to achieve, but it will only be loaded if it is found in one of your support paths, as specified in Options > Files > Support File Search Path. In the beginning, I assumed you could have many of these files in multiple support paths, but AutoCAD® will only load one. If there are many, AutoCAD® will load the first one that it finds in the order specified in your support paths. Support paths higher on the list will be searched before lower ones.

If you are working in a team that use several of the same lisp functions, a good idea is to place acad.lsp and acaddoc.lsp in some networked location, and add that location to you list of support paths. This is a much more manageable way, rather than trying to keep multiple files up to date on many computers. In order for these to run of course, it will have to be the first acad.lsp or acaddoc.lsp file that it finds, so you may have to rename or delete old versions of acad.lsp/acaddoc.lsp that already exist in local support paths.

So hopefully this has helped to understand acad.lsp and acaddoc.lsp. It’s pretty simple really, but knowing that little bit of extra detail can help to get things working the way that you want.

As always, I’d like to encourage newcomers to subscribe below, and you’ll get an email every time I write something new. If I don’t write anything, then you’ll get no email!
0 Likes