I am looking for a LISP routine that would do the following. I just want to be able to always start with the letter A in a drawing and continue through Z and then go to AA, AB, AC...... BA, BB, BC, etc. I also need a box drawn around the letters at the insertion point. I do not need it to prompt me for the letters if it is able to. I just want to pick and have it place A with a box, next pick is B with a box, etc. If I were to break out of the routine to do something I would like it to start where I left off. Thoughts? I have a routine that does this for numbers with a circle around it, but I am not good enough at LISP to figure out this version. Any help would be appriciated.
Paul Silzle
Solved! Go to Solution.
Solved by rkmcswain. Go to Solution.
Something like this
(defun mod (a b) (- a (* (/ a b) b))) (defun letter (i) (chr (+ i 64))) (defun letters (i / head tail) ;; 0 -> "A", 25 -> "Z", 26 -> "AA" (setq head (/ i 26) tail (mod i 26)) (if (zerop head) (letter i) (strcat (letters (1- head)) (letter tail))))
for generating the text to insert
--
The lisp routine in that link is perfect!!! That is exactly what we needed!! Thank you very much!!!
Thank you for the recommendation @Anonymous , much appreciated!
I'm glad you found the program useful @psilzle1968!
@martti.halminen why not use the rem function?
@Lee_Mac wrote:
@martti.halminen why not use the rem function?
Just forgot it existed; been lately reading Delphi code where the near equivalent is Mod.
--
Thank you for the recommendation @*R.K. McSwain , much appreciated!
The credit really goes to @rkmcswain - that other guy is never on here.... 😉
Thank you for the recommendation @*R.K. McSwain , much appreciated!
The credit really goes to @rkmcswain - that other guy is never on here.... 😉
Oops! That was the name which popped up automatically as I wrote the message
You can try attached INNB.vlx.
It doesn't add "A" as prefix automatically after letter "Z", but you can define it manually.
You can either draw a shape around the first letter and select the letter and the shape, or define a block with attribute.
Oops! That was the name which popped up automatically as I wrote the message
Ha. It's not our fault. I've got several other accounts floating around out there. Not because I created them, but I think it's a side effect of the NNTP to HTTP migration and other account migrations/adjustments that Autodesk has done over the years. I wish they would consolidate these into my current account. I'd gain 10,000 posts 🙂
Wow - you've been busy over the years RK
Can't find what you're looking for? Ask the community or share your knowledge.