Jump to content

Place text from Notepad as per origin point given in notepad (Delimitted with ;)


chvnprasad

Recommended Posts

Sample.txtHi

I need a lisp to place text as per given data in notepad. Innotepad Coordinates and Text is delimited with Semicolon (;) symbol. Need toread from notepad and place text as per Coordinate.

Thanks in Advance.

Link to comment
Share on other sites

You may build by yourself a script from that file; use Excel to speed-up the process.

_TEXT [color=magenta]0,0[/color] 5.0 0.0 [color=magenta]NAME1[/color]
_TEXT [color=magenta]1,1[/color] 5.0 0.0 [color=magenta]NAME2[/color]
_TEXT [color=magenta]2,2[/color] 5.0 0.0 [color=magenta]NAME3[/color]
_TEXT [color=magenta]3,3[/color] 5.0 0.0 [color=magenta]NAME4[/color]
<end of script>

Link to comment
Share on other sites

Thanks for Quick reply.

 

Actually i need a lisp. I am reading datafrom another software and save in notepad using Delimiter. based on this inputs from notepad lisp automatically need to place text.

Link to comment
Share on other sites

Here is the codes that I did post in the SWAMP .

(defun c:Test (/ f o Deconstruct_String cm st l)
 (if (and (setq f (getfiled "Select Txt file " "" "txt" 16))
          (setq o (open f "r"))
     )
   (progn
     (defun Deconstruct_String (st delimiter / p l)
       ;;    Tharwat 01. Nov. 2012     ;;
       (while (setq p (vl-string-search delimiter st 0))
         (setq l  (cons (substr st 1 p) l)
               st (substr st (+ p 2) (strlen st))
         )
       )
       (if st
         (setq l (cons st l))
       )
       (setq l (reverse l))
     )
     (setq cm (getvar 'CMDECHO))
     (setvar 'CMDECHO 0)
     (while (setq st (read-line o))
       (setq l (Deconstruct_String st ";"))
       (if (and l (vl-string-search "," (car l)) (eq (length l) 2))
         (vl-cmdf "_.TEXT" (car l) (getvar 'TEXTSIZE) "0." (cadr l))
       )
     )
     (setvar 'CMDECHO cm)
     (close o)
   )
 )
 (princ)
)

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