Hitting writers block here, my lisp will only create the 50th line or what ever line is set in the (repeat n ) function. I have approximately 1500~ lines in the text file. Any advice?
;**************************************
;CREATE PART NUMBER BLOCK
;**************************************
(defun C:csvblock (/ pt01)
(if (findfile "e:/lisps/csvblock.txt")
(progn
(setq btable (open "e:/lisps/csvblock.txt" "r"))
(repeat 50 (setq partnumber (read-line btable)))
(close btable)
) ; end progn
(alert "FILE NOT FOUND!")
) ; end if
(entmake
(list
(cons 0 "BLOCK") ; entity
(cons 2 partnumber) ; block name
(cons 70 2) ; block type
(list 10 0.0 0.0 0.0) ; base point
) ; end list
) ; end entmake
(entmake
(list
(cons 0 "TEXT") ; entity
(cons 8 "SYS-Bom_Part_Numbers") ; layer
(list 10 0.0 0.0 0.0) ; base point
(cons 40 0.035) ; text height
(cons 1 partnumber) ; text string
(cons 50 0) ; text rotation
; (cons 7 "STANDARD") ; text style
(cons 72 10) ; text justification
) ; end list
) ; end entmake text
;**************************************
;START ANNOTATIVE / NO EXPLODE SEQUENCE
;**************************************
(entmake
(list
(cons 0 "ENDBLK")
(cons 8 "0")
)
)
(entget (cdr (assoc 330 (entget (tblobjname "BLOCK" partnumber)))))
(vl-load-com)
(setq BLOCKS
(vla-get-Blocks
(vla-get-activedocument
(vlax-get-acad-object)
)
)
BLK (vla-Item BLOCKS partnumber)
)
(vla-put-explodable (vla-Item BLOCKS partnumber) :vlax-false)
(princ)
) ; end function