Lisp

I have a few lisps which will stop working properly after a time of intensive editing in largish files in 9.2 back to about v8. Some just fail, others give the "unknown command" response.

I close down and restart, they work again. In 9.3 the program crashes when the lisps fail. Does anyone else have the problem?

 "CT" below is a persistent "unknown command" issuer. Maybe there is something wrong with it?

It's usefulness has mostly been superseded by improvements in Icad, but it is helpful to change a text string to the system date by just pressing CR> after picking.

Can any of you clever lisp people see something wrong with it? (TIA)

(Defun C:ct ()
(Defun rew ()
(setq A (entsel "\nSelect Text to Change: "))
(if (not a)(rew)
(if (not (= "TEXT" (cdr (assoc 0 (entget (car a))))))(rew)))
)
(rew)
(setq ent (entget (car a)))
(print (cdr (assoc 1 ent)))
(PRINT "...Type = to match other text:")
(setq str (getstring T "\nNew string: "))
(if (= "=" str)
(setq str (cdr (assoc 1 (entget (car (entsel "\Pick text: ")))))))
(if (= "" str)
(progn
(setq str (rtos (getvar "cdate"))
a (substr str 7 2)
b (substr str 5 2))
(setq c (substr str 3 2)
str (strcat a "." b "." c))))
(setq a (subst (cons 1 str)(assoc 1 ent) ent))
(entmod a)(princ))


Comments

  • Do you still get the same problem if you declare your variables as local?

    (Defun C:ct ( / rew ent a b c)
    (Defun rew ( / )
    (setq A (entsel "\nSelect Text to Change: "))
    (if (not a)(rew)
    (if (not (= "TEXT" (cdr (assoc 0 (entget (car a))))))(rew)))
    )
    (rew)
    (setq ent (entget (car a)))
    (print (cdr (assoc 1 ent)))
    (PRINT "...Type = to match other text:")
    (setq str (getstring T "\nNew string: "))
    (if (= "=" str)
    (setq str (cdr (assoc 1 (entget (car (entsel "\Pick text: ")))))))
    (if (= "" str)
    (progn
    (setq str (rtos (getvar "cdate"))
    a (substr str 7 2)
    b (substr str 5 2))
    (setq c (substr str 3 2)
    str (strcat a "." b "." c))
    )
    )
    (setq a (subst (cons 1 str)(assoc 1 ent) ent))
    (entmod a)(princ)
    )
  • I can try. I used to do that as a matter of course, but nothing I read seemed to offer any reward for the extra bit of effort.

    Thanks Greg, I will give it a go.

  • I was heading out of the office when  I replied last time so I was brief.

    John, I have also noticed some odd behaviour after longer editing sessions with larger files. I do not have anything concrete yet to send in as a support request but it is interesting to hear of your experience also.

    I have a feeling I am experiencing problems more when I am working on a project that is not fully formed in my mind. In these situations I start and cancel operations a lot. Perhaps this is related, or it may be just my imagination. Sometimes I see the problem with Lisp you described but have thus far written it off to something I must have done. Sometimes Bricscad does not exit cleanly and sometimes I work for a whole day and it all goes well.

    I have to say I am very pleased with Bricscad overall. The addition of features and overall improvements are great and the few hicups I run into seem to get sorted straight away.

  • That seems to have worked. I went through and did that with my most commonly used lisps and no trouble or "running out of steam"  so far.

    Thanks very much Greg.

     A few also had stopped working because osnap instructions in lisp no longer recognise "endp", "perp" etc. in favour of "end", "per"...

This discussion has been closed.