Jump to content

Recommended Posts

Posted

i just found here a lisp before..just a little favor to modified this lisp. No problem with my desktop OS Vista using Land desktop 2004..yesterday i bought laptop OS xp home ED. sp3, try to use the lisp but i got some..it says "BAD URGEMENT; TYPE NIL..:(

 

SO HERE IS THE LISP..

(defun c:bdimp (/ doc spc file nl lst pt)
 (vl-load-com)

 (setq doc (vla-get-ActiveDocument
             (vlax-get-Acad-Object))
       spc (if (zerop (vla-get-activespace doc))
             (if (= (vla-get-mspace doc) :vlax-true) ; Vport
               (vla-get-modelspace doc)
               (vla-get-paperspace doc))
             (vla-get-modelspace doc)))

 (or (tblsearch "LAYER" "COORD")
   (vla-add (vla-get-layers doc) "COORD"))
 (if (setq file (getfiled "Select Text File"
                       (if *load$file* *load$file* "") "txt" )
   (progn
     (setq *load$file* file file (open file "r"))
     (while (setq nl (read-line file))
       (setq lst (cons (StrBrk nl 32) lst)))
     (close file)
     (foreach line lst
       (setq pt
         (mapcar 'distof
           (list (cadr line) (caddr line) "0.0")))
       (vla-put-layer
         (vla-AddPoint spc (vlax-3D-point pt)) "COORD")
       (Make_Text pt (car line) 0.0 "POINT NUMBER" 0 0 0)))  ; POINT NUMBER
   (princ "\n<!> No File Selected <!>"))
 (princ))


(defun StrBrk (str chrc / pos lst)
 (while (setq pos (vl-string-position chrc str))
   (setq lst (cons (substr str 1 pos) lst)
         str (substr str (+ pos 4))))
 (reverse (cons str lst)))

(defun Make_Text  (pt val rot lay |72 |73 obl)
 (entmake
   (list
     (cons 0 "TEXT")
     (cons 8  lay)
     (cons 10 pt)
     (cons 40 1.6)
     (cons 1  val)
     (cons 50 rot)
     (cons 51 obl)
     (cons 7  (getvar "TEXTSTYLE"))
     (cons 71 0)
     (cons 72 |72)
     (cons 73 |73)
     (cons 11 pt))))

:oops:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...