Jump to content

this block inserting lisp used to work


Tomislav
 Share

Recommended Posts

Hello.

I made this lisp years ago and haven't used it for a while so now it can't insert attributes when inserting block

(window for writing attribs pops out). I can't figure out how to resolve that so any suggestions?

(DEFUN C:uvb(/ f name coords textline textposition )

  (defun *error* (msg)
    (princ msg)
    (setvar "cmdecho" 1)
    )
  
  (vl-load-com)
  (setvar "cmdecho" 0)
  (setq coords nil)
  (setq f (open (getfiled "Izaberi datoteku s koordinatama i visinama za upisivanje u blok" (getvar 'DWGPREFIX) "txt" 8) "r"))
  (or(setq scale(getstring "\nUnesi scale faktor [0.5]: "))
     (setq scale "0.5")
     )
  (while(setq textline(read-line f))
    (setq prvi_zarez(+(vl-string-position(ascii ",")textline)1))
    (setq drugi_zarez(vl-string-position(ascii ",")textline prvi_zarez))
    (setq coords(substr textline 1 drugi_zarez))
    (setq visine (substr textline (+ 2 drugi_zarez) (strlen textline)))
    (setq teren(substr visine 1 (vl-string-position(ascii ",")visine)))
    (setq vod(substr visine (+(vl-string-position(ascii ",")visine)2)(strlen visine)))
    (vl-cmdf "-insert" "41423-1" coords scale "" teren vod)
    (setq textline nil
	  visine nil
	  coords nil
	  teren nil
	  vod nil
	  prvi_zarez nil
	  drugi_zarez nil)
    )
  (setvar "cmdecho" 1)
  (close f)  
)

;;;the file must be in format y,x,h1,h2

 

block.dwg

Link to comment
Share on other sites

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
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.

 Share

×
×
  • Create New...