TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: butzers09silverado on July 12, 2011, 08:45:27 AM

Title: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 08:45:27 AM
I'm trying to get the acad and acaddoc to load faster, anybody have suggestions?  I'm horrible at code.  FYI Some of the code has ; in front of them because they are "not in use"... easy way to keep the variables and not use them.

acad.lsp
Code: [Select]
; load system settings, vba, arx files

;(arxload "arxfile.arx")

(setvar "isavepercent" 0)
(setvar "filedia" 1)
(setvar "cmddia" 1)
(setvar "tooltips" 0)
(setvar "xrefnotify" 2)
(setvar "xloadctl" 2)
(setvar "visretain" 1)
(setvar "regenmode" 1)
(setvar "attmode" 1)
(setvar "attreq" 1)
(setvar "backgroundplot" 0)
(setvar "blipmode" 0)
(setvar "cmljust" 1)
(setvar "demandload" 3)
(setvar "draworderctl" 3)
(setvar "elevation" 0)
(setvar "fielddisplay" 1)
(setvar "fieldeval" 31)
(setvar "gridmode" 0)
(setvar "ucsvp" 0)
(setvar "XREFTYPE" 1)
(setvar "geomarkervisibility" 0)
(setvar "tooltips" 1)
(setvar "indexctl" 3)
(setvar "expert" 5)
(setvar "rollovertips" 0)
(setvar "publishcollate" 0)
;(setvar "hpdlgmode" 1)
;(setvar "layerdlgmode" 0)
(setvar "ssmautoopen" 0)
(setvar "OSNAPZ" 1)

here is the big bad one... acaddoc.lsp

Code: [Select]
; load only lisp and drawing settings in here

(setvar "mirrtext" 0)

(setvar "proxygraphics" 0)

;thaw and turn on layer 0
(command "-layer" "thaw" "0" "on" "0" "s" "0" "")

;creates thaws and turns on defpoints
(if (tblsearch "LAYER" "defpoints");;test if layer exists
(command "-layer" "thaw" "defpoints" "on" "defpoints" "") ;do this if exists
(command "-layer" "n" "defpoints" "c" "63" "defpoints" "");do this if not
)

;turns off wipeout frames
(command "wipeout" "f" "off")

;sets the view resoluton of circles on open
(command "viewres" "Y" "20000")

;set units for blocks dragged into drawing from design center
(command "insunits" 2)

;sets all fields in drawing to have gray background
(command "fielddisplay" 1)

;sets units of source drawings xreferenced or inserted into current drawing as unitless
(command "insunitsdefsource" 2)

;sets units of target or current drawings as unitless
(command "insunitsdeftarget" 2)

;forces to create a .bak file
(command "isavebak" 1)

;forces full saves
(command "isavepercent" 0)

;allows for 1000 layers to be sorted in a drawing
(command "maxsort" 10000)

;offsets polylines with no arcs
(command "offsetgaptype" 0)

;generates polyline linetype per segment instead of per total line
(command "savefidelity" 0)

;corrects annotative objects
(command "plinegen" 0)

;sets polyline width to 0 at drawing open
(command "plinewid" 0)

;sets polygon command to 3 sides instead of 4
(command "polysides" 3)

;sets ucsfollow to 0 so your screen doesn't follow ucs and zoom extents
(command "ucsfollow" 0)

;sets the available memory for raster images to 100mb instead of default 20mb
(setvar "rasterthreshold" 100)

;sets the maximum percent of the available virtual memory reserved for raster image plotting to 90% instead of default 20%
(setvar "rasterpercent" 90)

;sets your z elevation to 0
;(command "elevation" "0")
(setvar "elevation" 0)

;sets xrefs to remember layer state in drawing
(command "visretain" 1)

;sets you image frames to view but not print
(command "imageframe" 2)

;makes the stupid orb go away
(setvar "geomarkervisibility" 0)

;shuts off viewcube
(command "navvcubedisplay" OFF)

;shuts off navigation bar in viewport
(command "navbardisplay" 0)
(command "navvcube" off)

;shuts off navigation bar
(command "navbar" off)

;shuts off the grid
(command "gridmode" 0)

;resets the scale list in every drawing
;(command "-scalelistedit" "R" "Y" "E")

;sets the lineweight units to inches
(command "lwunits" 0)

;turns off lineweight display
(command "lwdisplay" "off")

;turns off ortho
(command "orthomode" 0)

;sets the autosave path
(command "savefilepath" C:\autosaves)


;sets viewport regen to require manual regen
(command "layoutregenctl" 2)


;not in use
;replaces xref menu with old type dialogue box
;(command "_.undefine" "xref")

;(defun c:xref nil (initdia) (command "_.classicxref"))

;replaces xref manager menu for classic images

;(command "_.undefine" "image")

;(defun c:image nil (initdia) (command "_.classicimage"))

Title: Re: load acaddoc and acad lsp faster?
Post by: kruuger on July 12, 2011, 08:58:58 AM
the best solution is to save template with all these variable set to proper value.
kruuger
Title: Re: load acaddoc and acad lsp faster?
Post by: alanjt on July 12, 2011, 09:07:59 AM
Many of your command calls within your 'big bad one' could be changed to using setvar, which would drastically increase time.
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 11:49:17 AM
we've given up on the template settings because we work with a lot of drawings that are not created from our templates.... for various legit reasons.

so can I just replace "command" with "setvar"?
Title: Re: load acaddoc and acad lsp faster?
Post by: ronjonp on July 12, 2011, 11:54:43 AM
See if this will help you out. Construct a list with variable name and value:

Code: [Select]
(defun setvars (/ lst x ds)
  (and (zerop (setq ds (getvar 'dimscale))) (setq ds 1))
  (setq lst '((acadlspasdoc . 1)
      (blipmode . 0)
      (cecolor . "bylayer")
      (celtscale . 1)
      (celtype . "bylayer")
      (cmddia . 1)
      (startup . 1)
      (textfill . 1)
      (textqlty . 100)
      (textsize . (* ds 0.125))
     )
  )
  (foreach x lst (vl-catch-all-apply 'setvar (list (car x) (eval (cdr x)))))
  (princ)
)
Title: Re: load acaddoc and acad lsp faster?
Post by: alanjt on July 12, 2011, 11:59:42 AM
Switch your dotted pair list to a normal list and you won't have to break up your list.

Code: [Select]
(foreach item '( ("cmdecho" 0) ("insunits" 0)) (vl-catch-all-apply 'setvar item))
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 12:06:08 PM
ok, i understand what you're doing here logically, I don't understand how alan's fixes ronjonp's.  It appears that alan is replacing the "for each" line at the bottom.

All i have to do is figure out how to list all the variables right?
Title: Re: load acaddoc and acad lsp faster?
Post by: MP on July 12, 2011, 12:44:48 PM
Switch your dotted pair list to a normal list and you won't have to break up your list.

Code: [Select]
(foreach item '( ("cmdecho" 0) ("insunits" 0)) (vl-catch-all-apply 'setvar item))

semantically I agree with you but with with no "eval section" you're breaking ron's code

just sayin'

:whistle:
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 12, 2011, 12:47:24 PM
I don't understand how alan's fixes ronjonp's.

Since the vl-catch-all-apply function requires a list of arguments (not dotted pairs), Alan constructs each item in the list as a list of the required arguments for the setvar function.

Whereas, since Ron uses dotted pairs for each item, each sublist needs to be 'deconstructed' into the two arguments for setvar, then reconstructed into a list using the list function.

Lee
Title: Re: load acaddoc and acad lsp faster?
Post by: ronjonp on July 12, 2011, 12:48:36 PM
Switch your dotted pair list to a normal list and you won't have to break up your list.

Code: [Select]
(foreach item '( ("cmdecho" 0) ("insunits" 0)) (vl-catch-all-apply 'setvar item))

semantically I agree with you but with with no "eval section" you're breaking ron's code

just sayin'

:whistle:

That's why I had the (eval (cdr x)) to account for (textsize . (* ds 0.125)) ... but if you're going with straight values I'd shorten it to Alan's suggestion. :-)
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 12, 2011, 12:53:18 PM
To satisfy both sides  :-P

Code: [Select]
(foreach item '(("cmdecho" 0) ("insunits" 0) ("textsize" (* ds 0.125)))
  (vl-catch-all-apply 'setvar (mapcar 'eval item))
)
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 01:02:55 PM
Thank you for the explanation, very helpful.  I'll give a go and see what happens tomorrow morning before everyone gets here  :kewl:

thanks again (for now, lol)
Title: Re: load acaddoc and acad lsp faster?
Post by: ronjonp on July 12, 2011, 01:03:43 PM
ok, i understand what you're doing here logically, I don't understand how alan's fixes ronjonp's.  It appears that alan is replacing the "for each" line at the bottom.

All i have to do is figure out how to list all the variables right?

Ok back to the regularly scheduled program  :-D

Yes ... just lookup the variables you want to change and add them to the list. My solution should work albeit not pretty to some  :-D
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 01:12:50 PM
I understand yours ronjonp, i just can't figure out how alan changed yours... i mean i understand it but understanding it and turning it into functioning code, well, you know.

anyways, I'll use yours ronjonp because i can see how to insert the variables.  Will this allow me to combine acad and acaddoc into 1 routine?

thanks.
Title: Re: load acaddoc and acad lsp faster?
Post by: ronjonp on July 12, 2011, 01:19:10 PM
It should combine most of it. Like Alan said ... try to reduce your command calls to speed it up.
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 01:22:03 PM
this is what i did for acad.lsp variables i had set, i'll take all the variables being set in acaddoc.lsp and put them in this code also....

that will leave acaddoc.lsp with the complex stuff i guess?...
here's what i've got
Code: [Select]
(defun setvars (/ lst x ds)
  (and (zerop (setq ds (getvar 'dimscale))) (setq ds 1))
  (setq lst '((acadlspasdoc . 1)
      (blipmode . 0)
      (cecolor . "bylayer")
      (celtype . "bylayer")
      (cmddia . 1)
      (startup . 1)
      (isavepercent . 0)
              (tooltips . 0)
              (xrefnotify . 2)
              (xloadctl . 2)
              (visretain . 1)
              (regenmode . 1)
      (attmode . 1)
      (attreq . 1)
              (backgroundplot . 0)
              (cmljust . 1)
              (demandload . 3)
              (draworderctl . 3)
              (elevation . 0)
              (fielddisplay . 1)
              (fieldeval . 31)
              (gridmode . 0)
              (ucsvp . 0)
              (xreftype . 1)
              (geomarkervisibility . 0)
              (tooltips . 1)
              (indexctl . 3)
              (expert . 5)
              (rollovertips . 0)
              (publishcollate . 0)
              (ssmautoopen . 0)
              (osnapz . 1)
     )
  )
  (foreach x lst (vl-catch-all-apply 'setvar (list (car x) (eval (cdr x)))))
  (princ)
Title: Re: load acaddoc and acad lsp faster?
Post by: ronjonp on July 12, 2011, 01:25:07 PM
One simple example to remove layer command calls:

Code: [Select]
(vl-load-com)
(if (and (setq l (tblobjname "LAYER" "defpoints")) (setq l (vlax-ename->vla-object l)))
  (progn (vla-put-layeron l :vlax-true) (vla-put-freeze l :vlax-false) (vla-put-color l 63))
)
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 01:31:56 PM
One simple example to remove layer command calls:

Code: [Select]
(vl-load-com)
(if (and (setq l (tblobjname "LAYER" "defpoints")) (setq l (vlax-ename->vla-object l)))
  (progn (vla-put-layeron l :vlax-true) (vla-put-freeze l :vlax-false) (vla-put-color l 63))
)

so vla-put-freeze l is looking back to the tblobjname for it's reference right.... arghhh i wish i could speak lisp, lol.  i can read it but i can't write it.

if you've seen days of thunder this is where cole trickle says to harry a bit of wedge here, track bar there... idiot, i don't get it.  they told me to drive, so i drove.
Title: Re: load acaddoc and acad lsp faster?
Post by: alanjt on July 12, 2011, 01:38:05 PM
Wouldn't this still work?

Code: [Select]
(foreach item (list '("cmdecho" 0) (list "dimscale" (+ 1. 25.))) (vl-catch-all-apply 'setvar item))
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 12, 2011, 03:16:14 PM
Wouldn't this still work?

Code: [Select]
(foreach item (list '("cmdecho" 0) (list "dimscale" (+ 1. 25.))) (vl-catch-all-apply 'setvar item))

I don't know... thats half the problem  :ugly:
Title: Re: load acaddoc and acad lsp faster?
Post by: dgorsman on July 12, 2011, 05:34:55 PM
Watch what you put, where, and how it may affect user operations.  For system variables, this mostly involves checking which are are stored in the registry and which are stored in drawings.  For those that are stored in the registry (like FILEDIA) you can set most of those just once for the session in acad.lsp.  For those saved in the drawing (like LTSCALE) keep in the acadDOC.lsp file.  If all you are doing is system variable settings, you might be better off simplifying it all down to a single acaddoc.lsp file.

Since command calls can take longer than simple system variable settings, you can look at wrapping them in some simple logic instead of invoking the command every time e.g. if setting X is good, don't do anything; otherwise call the function to fix it.
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 12, 2011, 06:14:57 PM
An aside following dgorsman's post, (I'm sure you knew this already):



ACAD.lsp
ACADLSPASDOC = 0
Loads acad.lsp into just the first drawing opened in an AutoCAD session, and will not load for each subsequently opened drawing.

ACADLSPASDOC = 1
Loads acad.lsp into every drawing opened.



ACADDOC.lsp
Loads for every drawing opened.



Order of Loading


Notes
AutoCAD will search for the above files in the working directory (DWGPREFIX), then all listed Support Directories and will load the first file found.
Title: Re: load acaddoc and acad lsp faster?
Post by: dgorsman on July 12, 2011, 06:43:02 PM
And to further Lee's points, SDI mode completely buggers that concept, loading acad.lsp in *everything* regardless of settings.  I know, I know... SDI belongs in the land of our computing forbearers but it still crops up here and there with third-party applications.
Title: Re: load acaddoc and acad lsp faster?
Post by: Krushert on July 13, 2011, 07:20:13 AM
I see that you are setting up a function (defun setvars  ... <damm alien language again> ... ) but what is calling it? 
Or you just assuming that the OP will put (setvars) somewhere in his code?
Title: Re: load acaddoc and acad lsp faster?
Post by: BlackBox on July 13, 2011, 10:06:35 AM
And to further Lee's points, SDI mode completely buggers that concept, loading acad.lsp in *everything* regardless of settings.  I know, I know... SDI belongs in the land of our computing forbearers but it still crops up here and there with third-party applications.

I don't follow... what does SDI=1 have to do with this?

I use SDI=1 for my Land Desktop projects, and have no issues with acad.lsp (ACADLSPASDOC = 0), or acaddoc.lsp loading. Both function exactly as Lee has clarified above.
Title: Re: load acaddoc and acad lsp faster?
Post by: dgorsman on July 13, 2011, 11:24:21 AM
Thats odd.  I have a third-party application that enforces SDI mode, and acad.lsp is loaded every time a document is opened.  Even the AutoCAD LSP documentation notes this.
Title: Re: load acaddoc and acad lsp faster?
Post by: BlackBox on July 13, 2011, 11:32:58 AM
Thats odd.  I have a third-party application that enforces SDI mode, and acad.lsp is loaded every time a document is opened.  Even the AutoCAD LSP documentation notes this.

Lee's post (above) acurately notes what is listed in the System Variable Editor for ACADLSPASDOC. Additionally this sysvar is saved to the registry, so if you normally use ACADLSPASDOC=0 (acad.lsp loaded once per session), then perhaps your 3rd-party app is setting SDI=1, and ACADLSPASDOC=1?  :?

Just a thought, as the only 3rd-party (non-Autodesk) app I use is AutoTURN.
Title: Re: load acaddoc and acad lsp faster?
Post by: dgorsman on July 13, 2011, 12:53:38 PM
Can't find the original AutoCAD reference, but SDI mode causes the ACADLSPASDOC setting to be ignored and effectively treat it as being set.  *shrug*  I've already verified this behavior experimentally.

Aha! http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=2897258&linkID=9240617 (http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=2897258&linkID=9240617)  Check the section marked "ACADLSPASDOC and SDI mode".
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 13, 2011, 03:17:14 PM
well, everything i am setting should apply to every drawing, therefore I'd like to set as much as possible PER SESSION, as long as that won't get overwritten by a template setting or something subsequent to initial open.

here is my code... for acad.lsp and it didn't work grid mode is still 1, osnapz is still 0, etc.... no errors though
Code: [Select]
; load system settings, vba, arx files

;(arxload "arxfile.arx")

(defun setvars (/ lst x ds)
  (and (zerop (setq ds (getvar 'dimscale))) (setq ds 1))
  (setq lst '((acadlspasdoc . 1)
      (blipmode . 0)
      (cecolor . "bylayer")
      (celtype . "bylayer")
      (cmddia . 1)
      (startup . 1)
      (isavepercent . 0)
              (tooltips . 0)
              (xrefnotify . 2)
              (xloadctl . 2)
              (visretain . 1)
              (regenmode . 1)
      (attmode . 1)
      (attreq . 1)
              (backgroundplot . 0)
              (cmljust . 1)
              (demandload . 3)
              (draworderctl . 3)
              (elevation . 0)
              (fielddisplay . 1)
              (fieldeval . 31)
              (gridmode . 0)
              (ucsvp . 0)
              (xreftype . 1)
              (geomarkervisibility . 0)
              (tooltips . 1)
              (indexctl . 3)
              (expert . 5)
              (rollovertips . 0)
              (publishcollate . 0)
              (ssmautoopen . 0)
              (osnapz . 1)
              (mirrtext . 0)
              (proxygraphics . 0)
              (insunitsdefsource . 2)
              (insunitsdeftarget . 2)
              (maxsort . 10000)
              (isavebak . 1)
              (isavepercent . 1)
              (offsetgaptype . 0)
              (savefidelity . 0)
              (plinegen . 0)
              (plinewid . 0)
              (polysides . 3)
              (ucsfollow . 0)
              (rasterthreshold . 100)
              (rasterpercent . 90)
              (elevation . 0)
              (imageframe . 2)
              (geomarkervisibility . 0)
              (navvcubedisplay . 0)
              (navbardisplay . 0)
              (lwdisplay . off)
              (gridmode . 0)
              (lwunites . 0)
              (orthomode . 0)
              (layoutregenctl . 0)
              (hpglmode . 1)
              (layerdlgmode . 0)           
     )
  )
  (foreach x lst (vl-catch-all-apply 'setvar (list (car x) (eval (cdr x)))))
  (princ) /[code]
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 14, 2011, 08:37:12 AM
Hi butzers09silverado,

Include the following in your ACADDOC.lsp:

Code: [Select]
(
  (lambda ( / err )
    (foreach x
     '(
        (acadlspasdoc 1)
        (blipmode 0)
        (cecolor "bylayer")
        (celtype "bylayer")
        (cmddia 1)
        (startup 1)
        (isavepercent 0)
        (tooltips 0)
        (xrefnotify 2)
        (xloadctl 2)
        (visretain 1)
        (regenmode 1)
        (attmode 1)
        (attreq 1)
        (backgroundplot 0)
        (cmljust 1)
        (demandload 3)
        (draworderctl 3)
        (elevation 0)
        (fielddisplay 1)
        (fieldeval 31)
        (gridmode 0)
        (ucsvp 0)
        (xreftype 1)
        (geomarkervisibility 0)
        (tooltips 1)
        (indexctl 3)
        (expert 5)
        (rollovertips 0)
        (publishcollate 0)
        (ssmautoopen 0)
        (osnapz 1)
        (mirrtext 0)
        (proxygraphics 0)
        (insunitsdefsource 2)
        (insunitsdeftarget 2)
        (maxsort 10000)
        (isavebak 1)
        (isavepercent 1)
        (offsetgaptype 0)
        (savefidelity 0)
        (plinegen 0)
        (plinewid 0)
        (polysides 3)
        (ucsfollow 0)
        (rasterthreshold 100)
        (rasterpercent 90)
        (elevation 0)
        (imageframe 2)
        (geomarkervisibility 0)
        (navvcubedisplay 0)
        (navbardisplay 0)
        (lwdisplay 0)
        (gridmode 0)
        (lwunits 0)
        (orthomode 0)
        (layoutregenctl 0)
        (hpglmode 1)
        (layerdlgmode 0)
      )
      (if (vl-catch-all-error-p (setq err (vl-catch-all-apply 'setvar x)))
        (princ (strcat "\n--> Error: " (vl-catch-all-error-message err)))
      )
    )
    (princ)
  )
)
Title: Re: load acaddoc and acad lsp faster?
Post by: alanjt on July 14, 2011, 08:39:20 AM
Hi butzers09silverado,

Include the following in your ACADDOC.lsp:

Code: [Select]
(
  (lambda ( / err )
    (foreach x
     '(
        (acadlspasdoc 1)
        (blipmode 0)
        (cecolor "bylayer")
        (celtype "bylayer")
        (cmddia 1)
        (startup 1)
        (isavepercent 0)
        (tooltips 0)
        (xrefnotify 2)
        (xloadctl 2)
        (visretain 1)
        (regenmode 1)
        (attmode 1)
        (attreq 1)
        (backgroundplot 0)
        (cmljust 1)
        (demandload 3)
        (draworderctl 3)
        (elevation 0)
        (fielddisplay 1)
        (fieldeval 31)
        (gridmode 0)
        (ucsvp 0)
        (xreftype 1)
        (geomarkervisibility 0)
        (tooltips 1)
        (indexctl 3)
        (expert 5)
        (rollovertips 0)
        (publishcollate 0)
        (ssmautoopen 0)
        (osnapz 1)
        (mirrtext 0)
        (proxygraphics 0)
        (insunitsdefsource 2)
        (insunitsdeftarget 2)
        (maxsort 10000)
        (isavebak 1)
        (isavepercent 1)
        (offsetgaptype 0)
        (savefidelity 0)
        (plinegen 0)
        (plinewid 0)
        (polysides 3)
        (ucsfollow 0)
        (rasterthreshold 100)
        (rasterpercent 90)
        (elevation 0)
        (imageframe 2)
        (geomarkervisibility 0)
        (navvcubedisplay 0)
        (navbardisplay 0)
        (lwdisplay 0)
        (gridmode 0)
        (lwunits 0)
        (orthomode 0)
        (layoutregenctl 0)
        (hpglmode 1)
        (layerdlgmode 0)
      )
      (if (vl-catch-all-error-p (setq err (vl-catch-all-apply 'setvar x)))
        (princ (strcat "\n--> Error: " (vl-catch-all-error-message err)))
      )
    )
    (princ)
  )
)
Minus printing the error message, this is the exact method I've been successfully using for quite some time.
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 14, 2011, 03:19:32 PM
Hi butzers09silverado,

Include the following in your ACADDOC.lsp:

Code: [Select]
(
  (lambda ( / err )
    (foreach x
     '(
        (acadlspasdoc 1)
        (blipmode 0)
        (cecolor "bylayer")
        (celtype "bylayer")
        (cmddia 1)
        (startup 1)
        (isavepercent 0)
        (tooltips 0)
        (xrefnotify 2)
        (xloadctl 2)
        (visretain 1)
        (regenmode 1)
        (attmode 1)
        (attreq 1)
        (backgroundplot 0)
        (cmljust 1)
        (demandload 3)
        (draworderctl 3)
        (elevation 0)
        (fielddisplay 1)
        (fieldeval 31)
        (gridmode 0)
        (ucsvp 0)
        (xreftype 1)
        (geomarkervisibility 0)
        (tooltips 1)
        (indexctl 3)
        (expert 5)
        (rollovertips 0)
        (publishcollate 0)
        (ssmautoopen 0)
        (osnapz 1)
        (mirrtext 0)
        (proxygraphics 0)
        (insunitsdefsource 2)
        (insunitsdeftarget 2)
        (maxsort 10000)
        (isavebak 1)
        (isavepercent 1)
        (offsetgaptype 0)
        (savefidelity 0)
        (plinegen 0)
        (plinewid 0)
        (polysides 3)
        (ucsfollow 0)
        (rasterthreshold 100)
        (rasterpercent 90)
        (elevation 0)
        (imageframe 2)
        (geomarkervisibility 0)
        (navvcubedisplay 0)
        (navbardisplay 0)
        (lwdisplay 0)
        (gridmode 0)
        (lwunits 0)
        (orthomode 0)
        (layoutregenctl 0)
        (hpglmode 1)
        (layerdlgmode 0)
      )
      (if (vl-catch-all-error-p (setq err (vl-catch-all-apply 'setvar x)))
        (princ (strcat "\n--> Error: " (vl-catch-all-error-message err)))
      )
    )
    (princ)
  )
)
Minus printing the error message, this is the exact method I've been successfully using for quite some time.

well that simplifies things... geeze, lol thank you
is that your routine or did you combine mine, i'll double check but it looks like you took my 2 files and made 1, or we have very similar setvars  :mrgreen:

edit:  after executing step 1, which was to put as many setvars as possible in acad.lsp, huge improvement.  Step 2, implement alanjt, even faster.  cut down startup noticeably.  THANK YOU.
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 14, 2011, 03:26:22 PM
I rewrote your code.
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 14, 2011, 03:30:23 PM
I rewrote your code.

In which repsonse... alanjt re-wrote it an posted it... did you post something different than alan?
Title: Re: load acaddoc and acad lsp faster?
Post by: Krushert on July 14, 2011, 03:38:59 PM
Thanks guys.  I learn alot of on this one, especially when I ran  Lee's "rewrote" code under the animation feature while watching the variables. 

Thanks.
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 14, 2011, 03:41:23 PM
Thanks guys.  I learn alot of on this one, especially when I ran  Lee's "rewrote" code under the animation feature while watching the variables. 

Thanks.

is there anyway to get that not animated, i can't see the animation... rats  ;-)  must be our sonicwall dough
Title: Re: load acaddoc and acad lsp faster?
Post by: BlackBox on July 14, 2011, 03:49:41 PM
is there anyway to get that not animated, i can't see the animation... rats  ;-)  must be our sonicwall dough

Read this (http://www.lee-mac.com/debugvlide.html), specifically the section on "Animating the Code."  :wink:
Title: Re: load acaddoc and acad lsp faster?
Post by: BlackBox on July 14, 2011, 03:50:37 PM
I learn alot of on this one...

1+

Cheers, guys! :beer:
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 14, 2011, 03:54:52 PM
that's pretty awesome  :kewl:
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 14, 2011, 05:31:12 PM
I rewrote your code.

In which repsonse... alanjt re-wrote it an posted it... did you post something different than alan?

No, Alan quoted my post (http://www.theswamp.org/index.php?topic=38890.msg440323#msg440323)  :wink:

Thanks guys :-)
Title: Re: load acaddoc and acad lsp faster?
Post by: Birdy on July 16, 2011, 09:40:54 AM
I learn alot of on this one...

1+

Cheers, guys! :beer:
x2  This has been a good read.

My question:
I'd like to alphabetize and comment the list.  Can I have a space like this between the A and B variables, and comment what they do:
Code: [Select]
(
  (lambda ( / err )
    (foreach x
     '(
        (acadlspasdoc 1)       ;|Loads acad.lsp into every drawing opened|;
        (attmode 1)            ;|Controls display of attributes |;
        (attreq 1)             ;|Controls whether INSERT uses default attribute settings |;

        (blipmode 0)           ;| Turns off the #!!@**!!#@ marker blips |;
        (backgroundplot 0)     ;| Controls whether background plotting is turned on or off |;
)
      (if (vl-catch-all-error-p (setq err (vl-catch-all-apply 'setvar x)))
        (princ (strcat "\n--> Error: " (vl-catch-all-error-message err)))
      )
    )
    (princ)
  )
)
Sorry for the remedial questions....
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 16, 2011, 09:45:04 AM
LISP doesn't evaluate whitespace, so you can have space between any expression.
Title: Re: load acaddoc and acad lsp faster?
Post by: Birdy on July 16, 2011, 09:56:52 AM
Thanks.  Is this proper commenting within the lambda function?
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 16, 2011, 10:03:41 AM
Thanks.  Is this proper commenting within the lambda function?

IMO, I rarely use multi-line comments (I think they look ugly), and only really use them when I specifically need to comment something within an expression on the same line, e.g.:

Code: [Select]
(setvar ;| Sets a System Variable |; 'OSMODE 0)
But this is a rare occurrence.

Usually I would opt for single [;] or double semi-colons [;;], and some use triple semi-colons [;;;] for headers.
Title: Re: load acaddoc and acad lsp faster?
Post by: Birdy on July 16, 2011, 10:10:24 AM
Thanks Lee!
You have been most helpful! 
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 16, 2011, 10:38:22 AM
You're welcome Jim.  :-)
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 18, 2011, 07:39:38 AM
speaking of remedial, how did you get them sorted a -> z (alphanumeric).... thats a good one too!
Title: Re: load acaddoc and acad lsp faster?
Post by: Birdy on July 18, 2011, 08:26:46 AM
speaking of remedial, how did you get them sorted a -> z (alphanumeric).... thats a good one too!
Why,..... the remedial way, how else! :-)
I copied in notes from the help file, just to aid me in future editing, and eliminated a few duplicated sysvars.  I also deleted newer settings (I'm still on acad 2008).
Some values I changed for my purposes, so examine before you use.
For your enjoyment:
Code: [Select]
(
  (lambda ( / err )
    (foreach x
     '(
        (acadlspasdoc 1) ; Controls whether the acad.lsp file is loaded into every drawing or just the first drawing opened in a session.
        (attmode 1) ; Controls display of attributes.
        (attreq 0) ; Controls whether INSERT uses default attribute settings during insertion of blocks.

        (blipmode 0) ; Controls whether marker blips are visible.
        (backgroundplot 3) ; Controls whether background plotting is turned on or off for plotting and publishing.

        (cecolor "bylayer") ; Sets the color of new objects. Valid values include BYLAYER, BYBLOCK, and an integer from 1 to 255.
        (celtype "bylayer") ; Sets the linetype of new objects.
        (cmddia 0) ; Controls the display of the In-Place Text Editor for the QLEADER command.
        (cmljust 0) ; Specifies multiline justification.

       
        (demandload 3) ; Specifies if and when to demand-load certain applications.
        (draworderctl 3) ; Controls the display order of overlapping objects.
       
        (elevation 0) ; Stores the current elevation of new objects relative to the current UCS.
        (expert 1) ; Controls whether certain prompts are issued.


        (fielddisplay 1) ; Controls whether fields are displayed with a gray background.
        (fieldeval 31) ; Controls how fields are updated. The setting is stored as a bitcode using the sum of the bits.

        (gridmode 0) ; Specifies whether the grid is turned on or off.
       
       
        (isavebak 1) ; Improves the speed of incremental saves, especially for large drawings.
        (isavepercent 0) ; If ISAVEPERCENT is set to 0, every save is a full save.
        (indexctl 3) ; Controls whether layer and spatial indexes are created and saved in drawing files.
        (insunits 1) ; Specifies a drawing-units value for automatic scaling of blocks, images, or xrefs inserted or attached to a drawing.

(insunitsdefsource 1) ; Sets source content units value when INSUNITS is set to 0.
        (insunitsdeftarget 1) ; Sets target drawing units value when INSUNITS is set to 0.
        (imageframe 1) ; Controls whether image frames are displayed and plotted.

        (lwdisplay 0) ; Controls whether the lineweight is displayed. The setting is saved with each tab in the drawing.
        (lwunits 1) ; Controls whether lineweight units are displayed in inches or millimeters.
        (layoutregenctl 0) ; Specifies how the display list is updated in the Model tab and layout tabs.
       
        (mirrtext 0)    ; Controls how the MIRROR command reflects text.   
        (maxsort 10000) ; Sets the maximum number of symbol names or block names sorted by listing commands.

        (offsetgaptype 0) ; Controls how potential gaps between segments are treated when closed polylines are offset.
        (osnapz 1) ; Controls whether object snaps are automatically projected onto a plane parallel to the XY plane of the current UCS at the current elevation.
        (orthomode 0) ; Constrains cursor movement to the perpendicular.

        (publishcollate 1) ; Controls whether sheets are published as a single job.
        (proxygraphics 1) ; Specifies whether images of proxy objects are saved in the drawing.
        (plinegen 0) ; Sets how linetype patterns generate around the vertices of a 2D polyline.
        (plinewid 0) ; Stores the default polyline width
        (polysides 6) ; Sets the default number of sides for the POLYGON command.

        (regenmode 1) ; Controls automatic regeneration of the drawing. See REGENAUTO command.
       
        (startup 0) ; Controls whether the Create New Drawing dialog box is displayed when a new drawing is started with NEW or QNEW.
        (ssmautoopen 0) ; Controls the display behavior of the Sheet Set Manager when a drawing associated with a sheet is opened.
        (savefidelity 1) ; Controls whether the drawing is saved with visual fidelity.  The setting is stored as a bitcode using the sum of the following values.

        (tooltips 1) ; Controls the display of tooltips on toolbars.
       
        (ucsvp 0) ; Determines whether the UCS in viewports remains fixed or changes to reflect the UCS of the current viewport.
        (ucsview 1) ; Determines whether the current UCS is saved with a named view.
(ucsfollow 0) ; Generates a plan view whenever you change from one UCS to another.

        (visretain 1) ; Controls the properties of xref-dependent layers. Controls visibility, color, linetype, lineweight, and plot styles.
(viewres 20000) ; Sets the resolution for objects in the current viewport. Integer from 1-20000.


        (xrefnotify 2) ; Controls the notification for updated or missing xrefs.
        (xloadctl 2) ; Turns xref demand-loading on and off, and controls whether it opens the referenced drawing or a copy.
        (xreftype 1) ; Controls the default reference type when attaching or overlaying an external reference.
      )
      (if (vl-catch-all-error-p (setq err (vl-catch-all-apply 'setvar x)))
        (princ (strcat "\n--> Error: " (vl-catch-all-error-message err)))
      )
    )
    (princ)
  )
)
Title: Re: load acaddoc and acad lsp faster?
Post by: Krushert on July 18, 2011, 09:23:02 AM
I copied in notes from the help file, just to aid me in future editing ...
I do the same thing but I place this code in a external file and then have that file loaded through the user's ACADDOC.lsp file by the use of the StartUP function; allowing me to change and add system vars in one place at anytime that I need to.  Just by doing that has cut my cad management headaches in half.  :wink:
Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 19, 2011, 01:53:02 PM
I copied in notes from the help file, just to aid me in future editing ...
I do the same thing but I place this code in a external file and then have that file loaded through the user's ACADDOC.lsp file by the use of the StartUP function; allowing me to change and add system vars in one place at anytime that I need to.  Just by doing that has cut my cad management headaches in half.  :wink:

we have our cui's pointed to a unc path for our lisp files that are part of the enterprise cui.... so that me or my buddy can fix stuff on the fly this also prevents the need to "push" stuff to end users, although i'd like to know how to do that....
anyways. :mrgreen:
Title: Re: load acaddoc and acad lsp faster?
Post by: Krushert on July 19, 2011, 06:34:33 PM
Check out this thread by Se7en. (http://www.theswamp.org/index.php?topic=31968.0) I think that is what is he teaching.  I don't know, at times it is all Greek to me.   :wink:
Title: Re: load acaddoc and acad lsp faster?
Post by: Jeff H on July 19, 2011, 06:41:50 PM
Check out this thread by Se7en. (http://www.theswamp.org/index.php?topic=31968.0) I think that is what is he teaching.  I don't know, at times it is all Greek to me.   :wink:
Fix that for you
Title: Re: load acaddoc and acad lsp faster?
Post by: Krushert on July 19, 2011, 06:49:14 PM
^ Thanks  :-)
Title: Re: load acaddoc and acad lsp faster?
Post by: Lee Mac on July 19, 2011, 08:01:54 PM
speaking of remedial, how did you get them sorted a -> z (alphanumeric).... thats a good one too!

A short bit of code to relieve the tediousness of doing it manually:

Code: [Select]
(defun _sort ( l ) (vl-sort l '(lambda ( a b ) (< (vl-prin1-to-string (car a)) (vl-prin1-to-string (car b))))))
On your list that I posted in post#29 (http://www.theswamp.org/index.php?topic=38890.msg440323#msg440323):

Code: [Select]
(_sort
 '(
    (acadlspasdoc 1)
    (blipmode 0)
    (cecolor "bylayer")
    (celtype "bylayer")
    (cmddia 1)
    (startup 1)
    (isavepercent 0)
    (tooltips 0)
    (xrefnotify 2)
    (xloadctl 2)
    (visretain 1)
    (regenmode 1)
    (attmode 1)
    (attreq 1)
    (backgroundplot 0)
    (cmljust 1)
    (demandload 3)
    (draworderctl 3)
    (elevation 0)
    (fielddisplay 1)
    (fieldeval 31)
    (gridmode 0)
    (ucsvp 0)
    (xreftype 1)
    (geomarkervisibility 0)
    (tooltips 1)
    (indexctl 3)
    (expert 5)
    (rollovertips 0)
    (publishcollate 0)
    (ssmautoopen 0)
    (osnapz 1)
    (mirrtext 0)
    (proxygraphics 0)
    (insunitsdefsource 2)
    (insunitsdeftarget 2)
    (maxsort 10000)
    (isavebak 1)
    (isavepercent 1)
    (offsetgaptype 0)
    (savefidelity 0)
    (plinegen 0)
    (plinewid 0)
    (polysides 3)
    (ucsfollow 0)
    (rasterthreshold 100)
    (rasterpercent 90)
    (elevation 0)
    (imageframe 2)
    (geomarkervisibility 0)
    (navvcubedisplay 0)
    (navbardisplay 0)
    (lwdisplay 0)
    (gridmode 0)
    (lwunits 0)
    (orthomode 0)
    (layoutregenctl 0)
    (hpglmode 1)
    (layerdlgmode 0)
  )
)

Returns the sorted list:

Code: [Select]
(
  (ACADLSPASDOC 1)
  (ATTMODE 1)
  (ATTREQ 1)
  (BACKGROUNDPLOT 0)
  (BLIPMODE 0)
  (CECOLOR "bylayer")
  (CELTYPE "bylayer")
  (CMDDIA 1)
  (CMLJUST 1)
  (DEMANDLOAD 3)
  (DRAWORDERCTL 3)
  (ELEVATION 0)
  (ELEVATION 0)
  (EXPERT 5)
  (FIELDDISPLAY 1)
  (FIELDEVAL 31)
  (GEOMARKERVISIBILITY 0)
  (GEOMARKERVISIBILITY 0)
  (GRIDMODE 0)
  (GRIDMODE 0)
  (HPGLMODE 1)
  (IMAGEFRAME 2)
  (INDEXCTL 3)
  (INSUNITSDEFSOURCE 2)
  (INSUNITSDEFTARGET 2)
  (ISAVEBAK 1)
  (ISAVEPERCENT 0)
  (ISAVEPERCENT 1)
  (LAYERDLGMODE 0)
  (LAYOUTREGENCTL 0)
  (LWDISPLAY 0)
  (LWUNITS 0)
  (MAXSORT 10000)
  (MIRRTEXT 0)
  (NAVBARDISPLAY 0)
  (NAVVCUBEDISPLAY 0)
  (OFFSETGAPTYPE 0)
  (ORTHOMODE 0)
  (OSNAPZ 1)
  (PLINEGEN 0)
  (PLINEWID 0)
  (POLYSIDES 3)
  (PROXYGRAPHICS 0)
  (PUBLISHCOLLATE 0)
  (RASTERPERCENT 90)
  (RASTERTHRESHOLD 100)
  (REGENMODE 1)
  (ROLLOVERTIPS 0)
  (SAVEFIDELITY 0)
  (SSMAUTOOPEN 0)
  (STARTUP 1)
  (TOOLTIPS 0)
  (TOOLTIPS 1)
  (UCSFOLLOW 0)
  (UCSVP 0)
  (VISRETAIN 1)
  (XLOADCTL 2)
  (XREFNOTIFY 2)
  (XREFTYPE 1)
)

 :-)
Title: Re: load acaddoc and acad lsp faster?
Post by: JohnK on July 19, 2011, 09:13:17 PM
I copied in notes from the help file, just to aid me in future editing ...
I do the same thing but I place this code in a external file and then have that file loaded through the user's ACADDOC.lsp file by the use of the StartUP function; allowing me to change and add system vars in one place at anytime that I need to.  Just by doing that has cut my cad management headaches in half.  :wink:
we have our cui's pointed to a unc path for our lisp files that are part of the enterprise cui.... so that me or my buddy can fix stuff on the fly this also prevents the need to "push" stuff to end users, although i'd like to know how to do that....
anyways. :mrgreen:
Check out this thread by Se7en. (http://www.theswamp.org/index.php?topic=31968.0) I think that is what is he teaching.  I don't know, at times it is all Greek to me.   :wink:

I set my office up similar to what butzers09silverado describes (keep as much stuff on the network as possible) but i do still have to install some things like updates to custom company software, replace a DLL, or even install new or updated programs, i need the power that an installer offers; sometimes a BAT or LSP file just doesn't cut it.

NSIS (that link) is an installer compiler (It makes installers). I use the NSIS installer language to write a "program" which i compile into an installer (You know what an installer is, Its the thing you download when you want to install a program...it asks you all those annoying questions like: do you agree, install this or that component, install this here, etc., etc.).

Does that help make `it' less `Greek'?
Title: Re: load acaddoc and acad lsp faster?
Post by: jaydee on July 19, 2011, 10:06:47 PM
Hi.
Just wondering anyone still use menus.
Menus and toolbars is something that that im getting use to and a must for any professional drafters.
In a multi-discipline trade, each have their own menu, and each section have their own setup.

What i do is having all their lisp and vars loaded from
.MNL file (this file will automaticall load with the associate .CUI/CUIX file)

Therefore each menu will have their own lisp and var settings.

My experience is that some default setting is good for you, but might not be likened by others.
eg
REMEMBERFOLDERS setting
some people are still prefer one way or the other.



Title: Re: load acaddoc and acad lsp faster?
Post by: butzers09silverado on July 20, 2011, 07:59:57 AM
speaking of remedial, how did you get them sorted a -> z (alphanumeric).... thats a good one too!

A short bit of code to relieve the tediousness of doing it manually:

Code: [Select]
(defun _sort ( l ) (vl-sort l '(lambda ( a b ) (< (vl-prin1-to-string (car a)) (vl-prin1-to-string (car b))))))
On your list that I posted in post#29 (http://www.theswamp.org/index.php?topic=38890.msg440323#msg440323):

Code: [Select]
(_sort
 '(
    (acadlspasdoc 1)
    (blipmode 0)
    (cecolor "bylayer")
    (celtype "bylayer")
    (cmddia 1)
    (startup 1)
    (isavepercent 0)
    (tooltips 0)
    (xrefnotify 2)
    (xloadctl 2)
    (visretain 1)
    (regenmode 1)
    (attmode 1)
    (attreq 1)
    (backgroundplot 0)
    (cmljust 1)
    (demandload 3)
    (draworderctl 3)
    (elevation 0)
    (fielddisplay 1)
    (fieldeval 31)
    (gridmode 0)
    (ucsvp 0)
    (xreftype 1)
    (geomarkervisibility 0)
    (tooltips 1)
    (indexctl 3)
    (expert 5)
    (rollovertips 0)
    (publishcollate 0)
    (ssmautoopen 0)
    (osnapz 1)
    (mirrtext 0)
    (proxygraphics 0)
    (insunitsdefsource 2)
    (insunitsdeftarget 2)
    (maxsort 10000)
    (isavebak 1)
    (isavepercent 1)
    (offsetgaptype 0)
    (savefidelity 0)
    (plinegen 0)
    (plinewid 0)
    (polysides 3)
    (ucsfollow 0)
    (rasterthreshold 100)
    (rasterpercent 90)
    (elevation 0)
    (imageframe 2)
    (geomarkervisibility 0)
    (navvcubedisplay 0)
    (navbardisplay 0)
    (lwdisplay 0)
    (gridmode 0)
    (lwunits 0)
    (orthomode 0)
    (layoutregenctl 0)
    (hpglmode 1)
    (layerdlgmode 0)
  )
)

Returns the sorted list:

Code: [Select]
(
  (ACADLSPASDOC 1)
  (ATTMODE 1)
  (ATTREQ 1)
  (BACKGROUNDPLOT 0)
  (BLIPMODE 0)
  (CECOLOR "bylayer")
  (CELTYPE "bylayer")
  (CMDDIA 1)
  (CMLJUST 1)
  (DEMANDLOAD 3)
  (DRAWORDERCTL 3)
  (ELEVATION 0)
  (ELEVATION 0)
  (EXPERT 5)
  (FIELDDISPLAY 1)
  (FIELDEVAL 31)
  (GEOMARKERVISIBILITY 0)
  (GEOMARKERVISIBILITY 0)
  (GRIDMODE 0)
  (GRIDMODE 0)
  (HPGLMODE 1)
  (IMAGEFRAME 2)
  (INDEXCTL 3)
  (INSUNITSDEFSOURCE 2)
  (INSUNITSDEFTARGET 2)
  (ISAVEBAK 1)
  (ISAVEPERCENT 0)
  (ISAVEPERCENT 1)
  (LAYERDLGMODE 0)
  (LAYOUTREGENCTL 0)
  (LWDISPLAY 0)
  (LWUNITS 0)
  (MAXSORT 10000)
  (MIRRTEXT 0)
  (NAVBARDISPLAY 0)
  (NAVVCUBEDISPLAY 0)
  (OFFSETGAPTYPE 0)
  (ORTHOMODE 0)
  (OSNAPZ 1)
  (PLINEGEN 0)
  (PLINEWID 0)
  (POLYSIDES 3)
  (PROXYGRAPHICS 0)
  (PUBLISHCOLLATE 0)
  (RASTERPERCENT 90)
  (RASTERTHRESHOLD 100)
  (REGENMODE 1)
  (ROLLOVERTIPS 0)
  (SAVEFIDELITY 0)
  (SSMAUTOOPEN 0)
  (STARTUP 1)
  (TOOLTIPS 0)
  (TOOLTIPS 1)
  (UCSFOLLOW 0)
  (UCSVP 0)
  (VISRETAIN 1)
  (XLOADCTL 2)
  (XREFNOTIFY 2)
  (XREFTYPE 1)
)

 :-)

SUPERB, so helpful.... dang.
Title: Re: load acaddoc and acad lsp faster?
Post by: irneb on July 20, 2011, 12:56:17 PM
Thanks.  Is this proper commenting within the lambda function?

IMO, I rarely use multi-line comments (I think they look ugly), and only really use them when I specifically need to comment something within an expression on the same line, e.g.:

Code: [Select]
(setvar ;| Sets a System Variable |; 'OSMODE 0)
But this is a rare occurrence.

Usually I would opt for single [;] or double semi-colons [;;], and some use triple semi-colons [;;;] for headers.
Of course if you use VLIDE's auto-formatting the comment types have some relevance. The multilines tend to get a space (or more depending on the setting) before it - if it starts on a line of its own. The single semi-colons are usually formatted with one or more spaces after whatever's on the line in front of it, also depending on some settings. The doubles are placed with the same indentation as the code surrounding it, and the tripples are always moved back to the start of the line. So something like this
Code: [Select]
;|My multiline
comment|;
(progn
;;; This comment won't get indented
;; but this one will
(some arb code)     ;With my single comment following
)
Will get formatted thus:
Code: [Select]
  ;|My multiline
comment|;
(progn
;;; This comment won't get indented
  ;; but this one will
  (some arb code) ;With my single comment following
)