Try with this......(It will insert number with default text style)
(defun c:circlesfromfile ( / i file line )
(if
(and
(setq file (getfiled "Select Data File" "" "txt" 16))
(setq file (open file "r"))
)
(progn
(setq i 0)
(while (setq line (read-line file))
(if
(and
(setq line (LM:str->lst line " "))
(= 3 (length line))
(setq line (mapcar 'distof line))
(vl-every 'numberp line)
(setq i (1+ i))
)
(entmakex
(list
(cons 0 "CIRCLE")
(list 10 (car line) (cadr line) 0.0)
(cons 40 (/ (caddr line) 2.0))
)
)
)
(command "text" "J" "MC" "_none" (list (car line) (cadr line) 0.0) "" "" i);It also can be done with entmake
)
(setq file (close file))
(princ (strcat "\n" (itoa i) " Circle(s) Created."))
)
)
(princ)
)
;;-------------------=={ String to List }==-------------------;;
;; ;;
;; Separates a string into a list of strings using a ;;
;; specified delimiter string ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; str - string to process ;;
;; del - delimiter by which to separate the string ;;
;;------------------------------------------------------------;;
;; Returns: A list of strings ;;
;;------------------------------------------------------------;;
(defun LM:str->lst ( str del / pos )
(if (setq pos (vl-string-search del str))
(cons (substr str 1 pos) (LM:str->lst (substr str (+ pos 1 (strlen del))) del))
(list str)
)
)
Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....