Results 1 to 4 of 4

Thread: Get a text from drawing

  1. #1
    Join Date
    May 2009
    Posts
    2

    Get a text from drawing

    How can I get a text from drawing and export to excel ?
    Thanks for help!

  2. #2
    Join Date
    May 2009
    Posts
    2

    ???

    Nobody!!!
    But, I 'd like gratefull everybody 'cos I gotta a solution!
    Thanks for all!

  3. #3
    Join Date
    Dec 2009
    Posts
    7
    Quote Originally Posted by xavier View Post
    Nobody!!!
    But, I 'd like gratefull everybody 'cos I gotta a solution!
    Thanks for all!
    Hi XAVIER
    I I do not know very well autocad vba , but I use this lisp file and make a txt file , perhaps this can solve your problem now .please save it as txttotxt.lsp and then use it.

    (DEFUN C:TXTTOTXT ()
    (SETQ F_N (GETSTRING "\nENTER NAME OF FILE TO SEND TEXT TO: "))
    (SETQ A (OPEN F_N "a"))
    (SETQ E (CAR (ENTSEL "\nSELECT LINE OF TEXT TO ADD TO TEXT FILE: ")))
    (SETQ E (ENTGET E))
    (SETQ TYP (CDR (ASSOC 0 E)))
    (COND
    ((= TYP "TEXT")
    (SETQ TXT (CDR (ASSOC 1 E)))
    (WRITE-LINE TXT A)
    )
    ((/= TYP "TEXT")
    (PROMPT "\nENTITY SELECTED IS NOT TEXT")
    )
    )
    (WHILE (/= E NIL) (SETQ E (CAR (ENTSEL
    "\nSELECT NEXT LINE TO ADD TO TEXT FILE: ")))
    (SETQ E (ENTGET E))
    (SETQ TYP (CDR (ASSOC 0 E)))
    (COND
    ((= TYP "TEXT")
    (SETQ TXT (CDR (ASSOC 1 E)))
    (WRITE-LINE TXT A)
    )
    ((/= TYP "TEXT")
    (PROMPT "\nENTITY SELECTED IS NOT TEXT")
    )
    )
    )
    (CLOSE A)
    (SETQ _PROMPT (STRCAT "\nFILE NAME USED IS " F_N))
    (PROMPT _PROMPT)
    )

  4. #4
    Join Date
    Dec 2009
    Posts
    7
    Dear xavier :
    Hi
    I have a lisp file that export your selected text to a text file . perhaps it solve your problem

    (DEFUN C:TXTTOTXT ()
    (SETQ F_N (GETSTRING "\nENTER NAME OF FILE TO SEND TEXT TO: "))
    (SETQ A (OPEN F_N "a"))
    (SETQ E (CAR (ENTSEL "\nSELECT LINE OF TEXT TO ADD TO TEXT FILE: ")))
    (SETQ E (ENTGET E))
    (SETQ TYP (CDR (ASSOC 0 E)))
    (COND
    ((= TYP "TEXT")
    (SETQ TXT (CDR (ASSOC 1 E)))
    (WRITE-LINE TXT A)
    )
    ((/= TYP "TEXT")
    (PROMPT "\nENTITY SELECTED IS NOT TEXT")
    )
    )
    (WHILE (/= E NIL) (SETQ E (CAR (ENTSEL
    "\nSELECT NEXT LINE TO ADD TO TEXT FILE: ")))
    (SETQ E (ENTGET E))
    (SETQ TYP (CDR (ASSOC 0 E)))
    (COND
    ((= TYP "TEXT")
    (SETQ TXT (CDR (ASSOC 1 E)))
    (WRITE-LINE TXT A)
    )
    ((/= TYP "TEXT")
    (PROMPT "\nENTITY SELECTED IS NOT TEXT")
    )
    )
    )
    (CLOSE A)
    (SETQ _PROMPT (STRCAT "\nFILE NAME USED IS " F_N))
    (PROMPT _PROMPT)
    )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •