Author Topic: loading lisp routines  (Read 11395 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
loading lisp routines
« Reply #15 on: March 09, 2005, 05:19:36 PM »
Quote from: danny
< .. >kerry,
that found the path
Code: [Select]
Command: (findfile"35.lsp")
"G:\\AutoCADD misc\\lisp files\\UCS&Crosshairs\\35.lsp"


so now how about this ?

(if (setq tmp  (findfile"35.lsp") ) (load tmp) (prompt "woooooooops"))
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.
loading lisp routines
« Reply #16 on: March 09, 2005, 05:23:15 PM »
Load this --

(defun *error* (msg) (vl-bt))

Now, what do these two statements output --

(load "G:\\AutoCADD misc\\lisp files\\UCS\\35.lsp")

(load "35.lsp")
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

danny

  • Guest
loading lisp routines
« Reply #17 on: March 09, 2005, 05:32:25 PM »
ok. I think i got it.
if I put this in the folder
Code: [Select]
;loads lisps at start-up
;loads lisps from directory -- "G:\\AutoCADD misc\\lisp files\\UCS"
(defun s::startup()
  (load "lisp here")
  (load "lisp here")
  (princ)
)

then ACAD will find the files.  This is similar to what dan posted earlier.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
loading lisp routines
« Reply #18 on: March 09, 2005, 05:55:32 PM »
MP, this is weird.
I have never used ampersand in folder names, so I tried it ...


Command: (findfile"test_load.lsp")
"F:\\This&That\\test_load.lsp"

Command: (if (setq tmp (findfile"test_load.lsp") ) (load tmp) (prompt "woooooooops"))

 Here We are, all together again ..
nil

Command: (load "test_load.lsp")

 Here We are, all together again ..
nil

Not a problem ... Weird, heh ..
WinXP Pro SP2
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.
loading lisp routines
« Reply #19 on: March 10, 2005, 12:57:55 AM »
That is weird Kerry. Sorry, I cant provide concrete examples, I have a vague recollection that some dos operations ( i.e. bat files ) went wonky with ampersands. I could be mistaken tho.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ELOQUINTET

  • Guest
loading lisp routines
« Reply #20 on: March 10, 2005, 08:50:02 AM »
danny yeah you just put this one lisp in your startup suite and add to it as you see fit. like i say this has worked the best for me

sinc

  • Guest
Re: loading lisp routines
« Reply #21 on: March 10, 2005, 12:13:09 PM »
Quote from: danny
I have my ACAD search path browsing to a folder which contains .lsp files and .mns file.  For some reason ACAD does not recognize the .lsp files.  How can I get this to work?

Just to be clear, by your "ACAD search path", you mean the "Support File Search Path" listing in the options dialog you get by typing OP, right?  Or are you talking about something else?

CADaver

  • Guest
loading lisp routines
« Reply #22 on: March 10, 2005, 12:33:24 PM »
Quote from: danny
Still doesn't reconize the .lsp files in that folder.  ... ACAD will not reconize it.
Okay, I'm slow, what do you mean by "recognize it"?  Is it not showing up in the appload list or what?

A lisp routine has to be loaded before it will function. Just placing the lisp file in a certain directory won't load it.  

If you want deman-loading look into autoload.
In you MNL or ACAD.LSP add lines similar to these:
Code: [Select]
(autoload "e:/programs/ac2002/menus/csa/UTE.lsp" '("ute"))
(autoload "e:/programs/ac2002/menus/csa/PLOTTABS.lsp" '("PLOTTABS" "PLTB"))
(autoload "e:/programs/ac2002/menus/csa/lisp/xrbg.lsp" '("xrbg"))
(autoload "E:/Programs/AC2002/Menus/csa/Lisp/cld.lsp" '("cldr" "cldh"))
If I enter the command CLDR or CLDH, the last autoload line above will load lisp function "E:/Programs/AC2002/Menus/csa/Lisp/cld.lsp", if it's not already loaded.  Notice that the keyboard entries match the defun names, not necessarily the function file name.

nivuahc

  • Guest
loading lisp routines
« Reply #23 on: March 10, 2005, 12:37:16 PM »
Quote from: CADaver
Quote from: danny
Still doesn't reconize the .lsp files in that folder.  ... ACAD will not reconize it.
Okay, I'm slow, what do you mean by "recognize it"?  Is it not showing up in the appload list or what?

A lisp routine has to be loaded before it will function. Just placing the lisp file in a certain directory won't load it.  

If you want deman-loading look into autoload.
In you MNL or ACAD.LSP add lines similar to these:
Code: [Select]
(autoload "e:/programs/ac2002/menus/csa/UTE.lsp" '("ute"))
(autoload "e:/programs/ac2002/menus/csa/PLOTTABS.lsp" '("PLOTTABS" "PLTB"))
(autoload "e:/programs/ac2002/menus/csa/lisp/xrbg.lsp" '("xrbg"))
(autoload "E:/Programs/AC2002/Menus/csa/Lisp/cld.lsp" '("cldr" "cldh"))
If I enter the command CLDR or CLDH, the last autoload line above will load lisp function "E:/Programs/AC2002/Menus/csa/Lisp/cld.lsp", if it's not already loaded.  Notice that the keyboard entries match the defun names, not necessarily the function file name.


Same way mine works.

I've been using the method I posted since AutoCAD R9.

CADaver

  • Guest
loading lisp routines
« Reply #24 on: March 10, 2005, 12:44:16 PM »
Quote from: nivuahc
Same way mine works.

I've been using the method I posted since AutoCAD R9.
I tried something similar to yours long ago, but I noodled it up somehow.  It kept getting hung in a never-ending loading loop.  Before I could figure out what I had noodled up, I found autoload.

nivuahc

  • Guest
loading lisp routines
« Reply #25 on: March 10, 2005, 12:51:09 PM »
Well the autoload method sure is cleaner, that's for sure.

You know what they say though... if it ain't broke, hire an architect. No. Wait. 'If it ain't broke don't fix it". That's it!

And, in defense of architects who might have taken offense to my mild attempt at humor I'll offer the following quote:

"If you think good architecture is expensive, try bad architecture."
- Brian Foote and Joseph Yoder

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7526
loading lisp routines
« Reply #27 on: March 10, 2005, 02:25:31 PM »
So I just loaded 2006 and set up my installer to load all my routines. I use CAB's method of loading my lisp but am getting this:

; error: no function definition: AUTOLOAD

My install uses Acad install and inno setup.
 Should place drop down menu......but didn't.

I have an acad.lsp with:

(AUTOLOAD "a2c" '("a2c"))
(AUTOLOAD "abl" '("abl"))
(AUTOLOAD "acret" '("acret"))......

and in my mnl file:

(vl-load-com)
(vl-vbaload (findfile "C:/Program Files/AutoCAD Tools/create_lyrs.dvb"))
(vl-vbaload (findfile "C:/Program Files/AutoCAD Tools/acad.dvb"))
(load "C:/Program Files/AutoCAD Tools/acad.lsp")
(princ)


HMMMM???

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
loading lisp routines
« Reply #28 on: March 10, 2005, 02:39:39 PM »
ronjonp

I have seen this before, I had a program to remove a search path and i got hose and deleted the "Main Search Path"

C:\Documents and Settings\tspangle\Application Data\Autodesk\AutoCAD 2006\R16.2\enu\support

and when that happened it will give you this error.  Obviuosly your will be differant unless you logon is the same as mine, in which case "I know your password" :lol:

look to see if you have a search path like this
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

ronjonp

  • Needs a day job
  • Posts: 7526
loading lisp routines
« Reply #29 on: March 10, 2005, 03:41:37 PM »
Tim,

I have that path in the support file seach paths??

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC