Author Topic: Compiling multiple lisps into one larger lisp...  (Read 8311 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Compiling multiple lisps into one larger lisp...
« Reply #15 on: June 03, 2004, 01:09:12 PM »
Quote from: Anonymous
RTFM is a powerful tool that every competent developer continually uses, and surprisingly, the very thing that frequently prevents casual coders from evolving. No attitude here, just statin' facts.
Oops. Sorry, thought I was logged in; my bad.

= All your lisp are belong to us =
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Compiling multiple lisps into one larger lisp...
« Reply #16 on: June 03, 2004, 01:15:09 PM »
Quote from: MPuckett

= All your lisp are belong to us =


lol...that's funny stuff....

I don't take offense to anything said...it's understandable...just be warned that if it happens again, I'll have to punchasize your face :twisted:






just kidding....

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Compiling multiple lisps into one larger lisp...
« Reply #17 on: June 03, 2004, 01:18:13 PM »
Quote
I don't take offense to anything said


.. you're no fun at all !!
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Compiling multiple lisps into one larger lisp...
« Reply #18 on: June 03, 2004, 01:24:50 PM »
Quote from: Dommy2Hotty

... I'll have to punchasize your face ...
A wise person once said:

"You can do anything you wish ... you only have to pay the consequences."
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Compiling multiple lisps into one larger lisp...
« Reply #19 on: June 03, 2004, 01:36:35 PM »
Quote from: Kerry Brown
Quote
I don't take offense to anything said


.. you're no fun at all !!


well, I know I'm a n00b at this stuff...so I expect to be made fun of for stupid questions...

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Compiling multiple lisps into one larger lisp...
« Reply #20 on: June 07, 2004, 04:39:50 PM »
Okay...got it all compiled, works perfectly (to the best of my knowledge).  Just one more question:  Does having the LISP's in a .mnl file take up memory like loading a LISP file thru the acad2004.lsp's Autoload section?  Or does it only load each LISP when it's called by the button?  Just wondering :twisted:

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Compiling multiple lisps into one larger lisp...
« Reply #21 on: June 07, 2004, 04:48:19 PM »
It all depends on how you set it up in the .mnl file. But if it were me I wouldn't worry about it that much with todays computers and the amount of ram thay have.
TheSwamp.org  (serving the CAD community since 2003)

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Compiling multiple lisps into one larger lisp...
« Reply #22 on: June 07, 2004, 05:18:22 PM »
Quote from: Mark Thomas
It all depends on how you set it up in the .mnl file.


Just like as follows, but with 19 total defun's for the 19 buttons on the toolbar.  Only difference between them is the defun name, block name, one different insert option on some, and one is on a different layer than the rest.

Code: [Select]

;;; Electrical.mnl file
;;; Dominic Cesare
;;; Last update: Fri June 4, 2004

;Duplex Outlet
(defun c:Duplex_Outlet (/ oldsnaps oldecho oldlayer block)
  ;error trapping
  (setq temperr *error*)
  (setq *error* trap1)
  ;storing current variables
  (setq oldlayer (getvar "clayer")
oldsnaps (getvar "osmode")
oldecho (getvar "cmdecho")
)
  ;turning snaps and echo off
  (setvar "osmode" 0)
  (setvar "cmdecho" 0)
  ;prompts user to select insertion point and rotation
  (prompt "\nSelect Insertion Point and Rotation.....")
  ;inserting block
  (command "-insert" "r1001" "nea" pause "" "" pause)
  ;setting the inserted block to "block"
  (setq block (entlast))
  ;creating PL-ELEC-FIXTURE layer if not present
  (if (not (tblsearch "layer" "PL-ELEC-FIXTURE"))
    (command ".layer" "m" "PL-ELEC-FIXTURE" "C" "3" "" "")
    )
  ;changing inserted block to the PL-ELEC-FIXTURE layer
  (command "change" block "" "p" "la" "PL-ELEC-FIXTURE" "")
  ;resetting system variables
  (setvar "clayer" oldlayer)
  (setvar "osmode" oldsnaps)
  (setvar "cmdecho" oldecho)
  ;error trapping
  (setq *error* temperr)
  ;ending silently
  (princ)
  )
;error trapping
(defun trap1 (errmsg)
  (command "u")
  (setvar "clayer" oldlayer)
  (setvar "osmode" oldsnaps)
  (setvar "cmdecho" oldecho)
  (setq *error* temperr)
  (prompt "Resetting System Variables.....")
  (princ)
  )

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Compiling multiple lisps into one larger lisp...
« Reply #23 on: June 07, 2004, 06:18:54 PM »
Sorry, my mistake. I did not understand what you were doing.  :oops:

IMO, the way you have it setup is fine, all the defun's in the .mnl file will be ready to use everytime you open a dwg. i.e. their are all loaded at once. My custom .mnl file is much the same way, except I have more than 19 in mine!! The programs I use on ocassion say once a day I load as needed, like so;
Code: [Select]

(defun c:program () (if (not c:program)(load "program")))

that way it's not loaded until I need it.
TheSwamp.org  (serving the CAD community since 2003)