+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Full Member
    Computer Details
    Stephen Shafer's Computer Details
    CPU:
    Intel Q6600
    RAM:
    4GB dual channel
    Graphics:
    EVGA 8800GT 512MB
    Primary Storage:
    2 hitachi 750GB 32MB cache in raid0
    Monitor:
    2 samsung 23" lcd
    Using
    AutoCAD 2009
    Join Date
    Nov 2008
    Posts
    26

    Default AutoLISP to convert text to block

    Registered forum members do not see this ad.

    Ok I searched around but apparently there is no right way to word this. Basically I have current AL to work with current blocks. I have a new customer who provides me with information I would normally have put into the block myself. What I would like to have happen is for something involving AutoLISP to take a piece of text and put that information into the current block, or something similar that the current AutoLISP can work with, so I can still gain the benefit of the customer providing me with this info now regards

  2. #2
    Senior Member wizman's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2007
    Location
    Abu Dhabi / Philippines
    Posts
    408

    Default

    mr. tony hotchkiss got at TEXT2ATT.LSP have a look at cadalyst.com
    Last edited by wizman; 12th Nov 2008 at 07:49 am. Reason: deleted wrong link

  3. #3
    Full Member
    Computer Details
    Stephen Shafer's Computer Details
    CPU:
    Intel Q6600
    RAM:
    4GB dual channel
    Graphics:
    EVGA 8800GT 512MB
    Primary Storage:
    2 hitachi 750GB 32MB cache in raid0
    Monitor:
    2 samsung 23" lcd
    Using
    AutoCAD 2009
    Join Date
    Nov 2008
    Posts
    26

    Default

    Wisman, Thats a great start and thanks for the lead. That actually does a lot of what I need it to do. It looks exactly what i need to look like as well. The existing block has three attributes and this has one. Basically my current block has street name (which is derived by selecting the block of a current street name) and then the address and number of units. What I would like to do is select the street name, then a range of addresses (currently in text) and then have all this information placed in a block for each piece of text which would resemble my current block so that i can use yet another LISP on it. thanks

  4. #4
    Senior Member wizman's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2007
    Location
    Abu Dhabi / Philippines
    Posts
    408

    Default

    stephen could you please post a sample drawing with your block with attributes. so that guys here can take a look at your goal.

  5. #5
    Full Member cadplayer's Avatar
    Computer Details
    cadplayer's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core CPU 3.4 GHz, 64bit system
    RAM:
    16GB RAM
    Graphics:
    NVIDIA GeForce GTX 400
    Using
    Civil 3D 2012
    Join Date
    May 2011
    Posts
    30

    Default

    i couldn´t find lisp

    cp

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,732

    Default

    What are you trying to achieve cadplayer?
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  7. #7
    Full Member cadplayer's Avatar
    Computer Details
    cadplayer's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core CPU 3.4 GHz, 64bit system
    RAM:
    16GB RAM
    Graphics:
    NVIDIA GeForce GTX 400
    Using
    Civil 3D 2012
    Join Date
    May 2011
    Posts
    30

    Default

    Quote Originally Posted by Lee Mac View Post
    What are you trying to achieve cadplayer?
    I think it would be very nice to convert text in blocks with attribut. I doesn´t find this tool on cadalyst.

  8. #8
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,732

    Default

    Quote Originally Posted by cadplayer View Post
    I think it would be very nice to convert text in blocks with attribut. I doesn´t find this tool on cadalyst.
    Use BEDIT on the block, then use this to convert Text to Attribute Definitions:

    Code:
    ;;-------------------=={ Text 2 Attribute }==-----------------;;
    ;;                                                            ;;
    ;;  Converts single-line text to an attribute definition.     ;;
    ;;------------------------------------------------------------;;
    ;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
    ;;------------------------------------------------------------;;
    
    (defun c:txt2att ( / el i ss st ) (vl-load-com)
      
      (if (setq ss (ssget "_:L" '((0 . "TEXT"))))
        (repeat (setq i (sslength ss))
          (setq el (entget (ssname ss (setq i (1- i))))
                st (vl-string-translate " " "_" (cdr (assoc 1 el)))
          )
          (if
            (entmakex
              (append '((0 . "ATTDEF"))
                (vl-remove-if '(lambda ( pair ) (member (car pair) '(0 100 73))) el)
                (list
                  (cons 70  0)
                  (cons 74 (cdr (assoc 73 el)))
                  (cons  2 st)
                  (cons  3 st)
                )
              )
            )
            (entdel (cdr (assoc -1 el)))
          )
        )
      )
      (princ)
    )
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  9. #9
    Full Member cadplayer's Avatar
    Computer Details
    cadplayer's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core CPU 3.4 GHz, 64bit system
    RAM:
    16GB RAM
    Graphics:
    NVIDIA GeForce GTX 400
    Using
    Civil 3D 2012
    Join Date
    May 2011
    Posts
    30

    Default

    yes this is very good. Is it possible to do attributs in a block.
    That means to convert text in attribut and paste in a block.

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,732

    Default

    Registered forum members do not see this ad.

    I assume you're asking for the reverse of what I have just provided? Yes, it would be possible, following the same method as I have in my previous code.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. AUTOLISP Insert block, and rotate
    By 420325 in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 11th Mar 2009, 12:03 pm
  2. Block Swap AutoLisp
    By johnalane in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 12th Aug 2008, 09:37 am
  3. Block variable - AutoLISP
    By alwe in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 30th Jul 2008, 02:57 pm
  4. creat block through autolisp
    By motee-z in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 16th Jun 2008, 10:49 pm
  5. Convert text to a block
    By ORgrown in forum AutoCAD General
    Replies: 2
    Last Post: 8th Aug 2005, 08:03 pm

Bookmarks

Posting Permissions

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