Author Topic: load acaddoc and acad lsp faster?  (Read 18971 times)

0 Members and 1 Guest are viewing this topic.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: load acaddoc and acad lsp faster?
« Reply #30 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.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

butzers09silverado

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #31 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.
« Last Edit: July 14, 2011, 03:27:49 PM by butzers09silverado »

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: load acaddoc and acad lsp faster?
« Reply #32 on: July 14, 2011, 03:26:22 PM »
I rewrote your code.

butzers09silverado

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #33 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?

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: load acaddoc and acad lsp faster?
« Reply #34 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.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

butzers09silverado

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #35 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

BlackBox

  • King Gator
  • Posts: 3770
Re: load acaddoc and acad lsp faster?
« Reply #36 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, specifically the section on "Animating the Code."  :wink:
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: load acaddoc and acad lsp faster?
« Reply #37 on: July 14, 2011, 03:50:37 PM »
I learn alot of on this one...

1+

Cheers, guys! :beer:
"How we think determines what we do, and what we do determines what we get."

butzers09silverado

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #38 on: July 14, 2011, 03:54:52 PM »
that's pretty awesome  :kewl:

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: load acaddoc and acad lsp faster?
« Reply #39 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  :wink:

Thanks guys :-)

Birdy

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #40 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....

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: load acaddoc and acad lsp faster?
« Reply #41 on: July 16, 2011, 09:45:04 AM »
LISP doesn't evaluate whitespace, so you can have space between any expression.

Birdy

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #42 on: July 16, 2011, 09:56:52 AM »
Thanks.  Is this proper commenting within the lambda function?

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: load acaddoc and acad lsp faster?
« Reply #43 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.

Birdy

  • Guest
Re: load acaddoc and acad lsp faster?
« Reply #44 on: July 16, 2011, 10:10:24 AM »
Thanks Lee!
You have been most helpful!