Author Topic: lisp loading problem  (Read 6794 times)

0 Members and 1 Guest are viewing this topic.

diarmuid

  • Bull Frog
  • Posts: 417
lisp loading problem
« on: March 29, 2004, 06:26:17 AM »
lisp loading query

when i "appload" a lisp that i may not use very often it, on occasion, doesn't work.  acad tells me that "chgelev.lsp has loaded succesfully", but when i type chgelev the command to activate the lisp nothing happens.  if type (load "chgelev") it says load failed but then it works.  this is puzzeling, could anybody  explain what could be the problem?

thanks in advance

Diarmuid
If you want to win something run the 100m, if you want to experience something run a marathon

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
lisp loading problem
« Reply #1 on: March 29, 2004, 06:34:04 AM »
What happens if you drag-n-drop the 'chgelev.lsp' from Windows explorer into acad?
TheSwamp.org  (serving the CAD community since 2003)

hyposmurf

  • Guest
lisp loading problem
« Reply #2 on: March 29, 2004, 06:55:50 AM »
Is it possible that the defun part has been called something else or is just slightly different than the actual lisp file name?

hyposmurf

  • Guest
lisp loading problem
« Reply #3 on: March 29, 2004, 06:56:13 AM »
Is it possible that the defun part has been called something else or is just slightly different than the actual lisp file name?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
lisp loading problem
« Reply #4 on: March 29, 2004, 08:06:07 AM »
It might be that you have more than one version of the program on your system and as a result AutoCAD loads the FIRST one it finds when you load it by the command line, but when you browse for the file you load the one you see, which could be a different version.

As far as telling you one thing and doing another, unless we see some code, we won't know for sure. I think that what you are describing is probably related to the multiple files issue though.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CADaver

  • Guest
lisp loading problem
« Reply #5 on: March 29, 2004, 08:06:14 AM »
Yo hypo  you're stuttering again... switch to Bourbon.

diarmuid

  • Bull Frog
  • Posts: 417
heres the routine
« Reply #6 on: March 29, 2004, 08:19:39 AM »
;; change elevation - chgelev.lsp
(defun newelev (elv)
   (princ "\rWorking \\")
   (if (assoc 10 ei)
      (progn
         (setq pt (cdr (assoc 10 ei)))
         (setq xc (car pt))
         (setq yc (cadr pt))
         (setq zc elv)
         (setq coord (list xc yc zc))
         (setq ei (subst (cons 10 coord) (assoc 10 ei) ei))
         (princ "\rWorking |")
         (entmod ei)
      )
   )
   (princ "\rWorking /")
   (if (assoc 11 ei)
      (progn
         (setq pt (cdr (assoc 11 ei)))
         (setq xc (car pt))
         (setq yc (cadr pt))
         (setq zc elv)
         (setq coord (list xc yc zc))
         (setq ei (subst (cons 11 coord) (assoc 11 ei) ei))
         (princ "\rWorking -")
         (entmod ei)
      )
   )
)

(defun c:chgelev ()
   (setvar "cmdecho" 0)
   (princ "\nChange Entities Elevation. ")
   (setq ss (ssget))
   (setq ssl (sslength ss))
   (setq elv (getreal "\nEnter new elevation: "))
   (setq loop 0)
   (while (< loop ssl)
      (setq e (ssname ss loop))
      (setq ei (entget e))
      (if (= (cdr (assoc 66 ei)) 1)
         ;; THEN
         (while (/= (cdr (assoc 0 ei)) "SEQEND")
            (setq zi ei z e)
            (newelev elv)
            (setq e (entnext z))
            (setq ei (entget e))
         )
         ;; ELSE
         (newelev elv)
      )
      (entupd e)
      (setq loop (1+ loop))
   )
   (princ "\rDone!!! All entities Z coordinate at ")
   (princ (rtos elv 2 2))
   (setvar "cmdecho" 1)
   (setvar "highlight" 1)
   (princ) (terpri)
)
If you want to win something run the 100m, if you want to experience something run a marathon

hyposmurf

  • Guest
lisp loading problem
« Reply #7 on: March 29, 2004, 10:45:11 AM »
Quote from: CADaver
Yo hypo  you're stuttering again... switch to Bourbon.

Its my company inter..ter..ter..ternet,going ti..ti..ti..tits up again,you think youve posted then it crashes,so you resubmit!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
lisp loading problem
« Reply #8 on: March 29, 2004, 11:20:38 AM »
Quote from: diarmuid
but when i type chgelev the command to activate the lisp nothing happens.


You mean you don't get an error message???


My thought was that you switched drawings after loading and the routine will not be available in another drawing.

CAB
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.

t-bear

  • Guest
lisp loading problem
« Reply #9 on: March 29, 2004, 11:21:00 AM »
Dar....
The defun looks like it matches the lisps name so....
Don't know if it matters but, is the lsp in your startup suite?  If not, try loading it into there and see if that helps......
Like I said, just a thought.

hyposmurf

  • Guest
lisp loading problem
« Reply #10 on: March 29, 2004, 02:32:51 PM »
Even try loading it on another PC thjen youll know if its specific to your PC alone,or its the lisp that is causing you problems.Or in a rather crap less likely situation the fault occurs on a number PC's.  :crazy:

diarmuid

  • Bull Frog
  • Posts: 417
lisp loading problem
« Reply #11 on: March 30, 2004, 02:22:28 AM »
its really wierd, the lisp works well on a machine, and for no apparent reason it just doesn't excecute on a given day.  it tells me that it has loaded successfully, then when i type chgelev at the command prompt, nothing , and i mean nothing happens, no error, exlamation marks nothing, even the word "command:" that appears on every line doesn't appear

Thanks in advance

Diarmuid
If you want to win something run the 100m, if you want to experience something run a marathon

hyposmurf

  • Guest
lisp loading problem
« Reply #12 on: March 30, 2004, 06:52:47 AM »
Does it not like Monday mornings? :)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
lisp loading problem
« Reply #13 on: March 30, 2004, 08:04:31 AM »
I am beginning to wonder if you might have a lisp that has assigned a value to a protected symbol...if you do, then it might prevent the lisp from working, and from displaying the command prompt. It might in fact be stuck in some sort of loop.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

diarmuid

  • Bull Frog
  • Posts: 417
lisp loading problem
« Reply #14 on: March 30, 2004, 08:45:06 AM »
its an irish lisp routine, it doesn't like mornings, work, effort.

lol

Diarmuid
If you want to win something run the 100m, if you want to experience something run a marathon