@Anonymous wrote:
i am looking for a AutoLISP command which converts a float to a string.
Pls help!
Hmmmmmn
This?
(defun _floattostring (f) (defun replace-n (new n lst /) (mapcar '(lambda (a) (if (= (setq n (1- n)) -1) new a)) lst)) (if (eq (Strcase f t) "float") (progn (setq n -1 f (vl-string->list f)) (setq strin (mapcar (function (lambda (a b c) (setq d nil n (1+ n) symb (if (minusp a) 1- 1+)) (repeat (abs a) (setq d (cons (setq f (replace-n (setq b (symb b)) n f)) d))) ) ) '(13 8 3 8 -6) f '(115 116 114 105 110)) ) (textscr) (foreach itm (cons '(102 108 111 97 116) (append (apply 'append (mapcar 'reverse strin)) '((115 116 114 105 110 103)))) (print (vl-list->string itm)) (princ) ) (princ "<<--- TADA!! ") ) (alert(Strcat "\nHey!! I said float not " (Strcase f ))) ) (princ) )
(_floattostring "float")
HTH
"All work and no play makes pBe a dumb boy"
😄