Thanks for all your help Peter!
I was able to create some code to do the text selection and offset and call your routines.
I am not sure how it all works yet. It needs some error checking to stop if an offset is going to cause text less that 'A'.
I realize now that some of the text is in blocks. That seems a bit more difficult to try to change. I will keep searching for code to do this also.
Code:
;___________________________________________________________________________________________________________|
(defun c:TEXT_Offset ( / entSelection intCount intLen strBase strList strNew strOld Offset )
(setq strBase "ABCDEFGHJKLMNPRSTUVWXYZ") ;AlphaNumeric
(prompt "\nSelect Text to Change (any order):")
(if (setq strList (ssget '((0 . "TEXT"))))
(progn
(setq intCount 0
intLen (sslength strList)
)
(setq Offset (getint "Enter Offset (+#/-#):"))
(while (< intCount intLen)
(setq entSelection (ssname strList intCount)
strOld (cdr(assoc 1 (entget entSelection))) ;Get text from list
intNumber (BaseKToBase102 strBase strOld); <- Convert BaseK String to Integer
intNumber (+ Offset intNumber)
strNew (Base10ToBaseK2 strBase intNumber); <-Convert Integer to BaseK string
entSelection (entget (ssname strList intCount))
entSelection (subst (cons 1 strNew) (assoc 1 entSelection) entSelection)
)
(entmod entSelection)
(Setq intCount (1+ intCount))
)
)
)
(princ)
)
;___________________________________________________________________________________________________________|
; By Peter http://forums.augi.com/
(defun Base10ToBaseK2 (strBase intNumber / intBase intDigit intRemainder lstReturn )
(setq intBase (strlen strBase))
(if (= intNumber 0)(setq lstReturn (list 0)))
(while (> intNumber 0)
(setq intDigit (/ intNumber intBase))
(setq intRemainder (- intNumber (* intBase intDigit)))
(or (> intRemainder 0)
(setq intRemainder intBase intDigit (1- intDigit))
)
(setq lstReturn (cons intRemainder lstReturn))
(setq intNumber intDigit)
)
(apply 'strcat (mapcar '(lambda (X)(substr strBase X 1)) lstReturn))
)
;___________________________________________________________________________________________________________|
; By Peter http://forums.augi.com/
(defun BaseKToBase102 (strBase strValue / intBase intCount intTotal)
(setq intBase (strlen strBase))
(setq intTotal 0)
(repeat (setq intCount (strlen strValue))
(setq intTotal (+ intTotal
(* (expt intBase (- (strlen strValue) intCount))
(1+ (vl-string-search (substr strValue intCount 1) strBase))
)
)
)
(setq intCount (1- intCount))
)
intTotal
)
(vl-load-com)