Simple lisp routine bombs.

#1
I found a snippet that I need to keep adding letters to, it's so I can make my own font, that's the long story short:

Code: Select all

(defun c:tb ()
(setq obj (vlax-ename->vla-object (car (entsel "Pick text")))) (setq str (vlax-get obj 'textstring)) (setq x 0) (repeat (strlen str) (setq char (substr str (setq x (+ x 1)) 1 )) (cond ((= char "a" )(setq bname "Blocka" wid 1.12)) ((= char "b" )(setq bname "Blockb" wid 1.0)) ((= char "c" )(setq bname "Blockc" wid 0.85)) ((alert (strcat "Character not supported " char))) ) (princ (strcat "\n" bname " " char)) )
)
At runtime I get this after picking the text string:
error: application is locked and cannot be unloaded.

I've never seen that error before!
I make 3 blocks named Blocka, Blockb & Blockc of polyline letters a,b, & c for testing, I have a text string: "abc", when I run it, its supposed to insert the 3 blocks and look like new text.
Any ides why the error?
Thanks!
Daily user of Intergraph MicroStation 1987 - 1991, then AutoCAD until 2020, now IntelliCAD. Wanting to fully learn iCad and share my knowledge of applicable crossover info from Acad.
-=(RLH)=-

Re: Simple lisp routine bombs.

#3
Thanks Quan,
I didn't know about the </> tags for the forum.
It no longer errors but also does not insert the blocks.
There has to be another line missing or something.
Hmmmm.
Thanks
Daily user of Intergraph MicroStation 1987 - 1991, then AutoCAD until 2020, now IntelliCAD. Wanting to fully learn iCad and share my knowledge of applicable crossover info from Acad.
-=(RLH)=-

Re: Simple lisp routine bombs.

#5
Someone else on another forum wrote it for me, I think he assumed that I know how to finish the code but I do not.
Ramon
Daily user of Intergraph MicroStation 1987 - 1991, then AutoCAD until 2020, now IntelliCAD. Wanting to fully learn iCad and share my knowledge of applicable crossover info from Acad.
-=(RLH)=-