+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Forum Newbie Srinivas.Vinjamuri's Avatar
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    1

    Question Text 2 Attribute

    Registered forum members do not see this ad.

    Hi All,
    Is anybody having lisp programme to change text to attributes?
    Thanks,
    Srinivas Vinjamuri

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2015
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    39,764

    Default

    You might try over at The Swamp. www.theswamp.org

    You'll have to join the forum though. Once you do that conduct a search using as the criteria "text to attribute". Include the quotation marks. It should bring up a post by DanB, Bull Frog containing Carl Rockstrom's Text to Attribute lisp routine. The thread is dated March 02, 2005.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge! I've gone over to the dark side.

  3. #3
    Senior Member
    Computer Details
    flowerrobot's Computer Details
    Operating System:
    Windowns 7
    Computer:
    Lenovo W520
    Discipline
    Mechanical
    flowerrobot's Discipline Details
    Occupation
    Cad Manger
    Discipline
    Mechanical
    Using
    Mechanical 2013
    Join Date
    Sep 2007
    Location
    Sydney
    Posts
    384

    Default

    Or Command "burst"
    (sorry For Bringing This Alive, Couldnt Help My Self)

  4. #4
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Professional 64 bit
    Computer:
    HP EliteBook 8570w
    CPU:
    Intel Core i7-3720QM 2.60GHz
    RAM:
    16GB
    Graphics:
    NVIDIA Quadro K2000M
    Monitor:
    HP
    Discipline
    Civil
    Tiger's Discipline Details
    Occupation
    Education /support
    Discipline
    Civil
    Details
    Support/Education/Retail
    Using
    Civil 3D 2015
    Join Date
    Nov 2006
    Location
    Stockholm, Sweden
    Posts
    5,049

    Default

    Quote Originally Posted by flowerrobot View Post
    Or Command "burst"
    (sorry For Bringing This Alive, Couldnt Help My Self)
    It's ok, but BURST changes Attributes to Text - not the other way around, which is what the OP was asking
    whether is when you are asking yourself, should I stay or should I go
    weather is when it's cold as all that outside
    wether is a goat soprano
    #SpellingMatters

  5. #5
    Senior Member
    Computer Details
    flowerrobot's Computer Details
    Operating System:
    Windowns 7
    Computer:
    Lenovo W520
    Discipline
    Mechanical
    flowerrobot's Discipline Details
    Occupation
    Cad Manger
    Discipline
    Mechanical
    Using
    Mechanical 2013
    Join Date
    Sep 2007
    Location
    Sydney
    Posts
    384

    Default

    dnt i feel like a fool.
    I thought i finnaly knew an answer

  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
    16,780

    Default

    Quote Originally Posted by flowerrobot View Post
    dnt i feel like a fool.
    I thought i finnaly knew an answer
    Haha, no worries FlowerRobot, When I saw the OP, Burst immediatley sprang to mind...
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  7. #7
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,055

    Default

    This should do the trick
    Code:
    (defun txt2attd (/ ss ct en ed)
      (while (or (not ss)
                 (> (sslength ss) 1))
             (princ "\nSelect A TEXT to Convert to ATTDEF:   ")
             (setq ss (ssget (list (cons 0 "TEXT")
                                   (if (setq ct (getvar "CTAB"))
                                       (cons 410 ct)
                                       (cons 67 (- 1 (getvar "TILEMODE")))))))
              (setq en (ssname ss 0)
                    ed (entget en))
              (and (wcmatch (cdr (assoc 1 ed)) "* *")
                   (getstring "\nString Contains Spaces - Try Again...")
                   (setq ss nil)))
      (entmake (list (cons 0 "ATTDEF")
                     (assoc 8 ed)
                     (assoc 10 ed)
                     (assoc 11 ed)
                     (assoc 7 ed)
                     (assoc 40 ed)
                     (assoc 41 ed)
                     (assoc 50 ed)
                     (assoc 51 ed)
                     (cons 70 0)
                     (assoc 71 ed)
                     (assoc 72 ed)
                     (cons 74 (cdr (assoc 73 ed)))
                     (assoc 210 ed)
                     (cons 1 "")
                     (cons 2 (cdr (assoc 1 ed)))
                     (cons 3 (cdr (assoc 1 ed)))
                     (if (assoc 6 ed) (assoc 6 ed)'(6 . "BYLAYER"))
                     (if (assoc 39 ed) (assoc 39 ed)'(39 . 0))
                     (if (assoc 62 ed) (assoc 62 ed)'(62 . 256))))
      (entdel en)
      (redraw)
      (prin1))
    -David
    R12 (Dos) - A2K

  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
    16,780

    Default

    David, why not use:

    Code:
    (defun c:txt2attd (/ ss ct en ed)
      (while (not ss)
             (princ "\nSelect A TEXT to Convert to ATTDEF:   ")
             (setq ss (ssget "_:S" (list (cons 0 "TEXT")
                                   (if (setq ct (getvar "CTAB"))
                                       (cons 410 ct)
                                       (cons 67 (- 1 (getvar "TILEMODE")))))))
              (setq en (ssname ss 0)
                    ed (entget en))
              (and (wcmatch (cdr (assoc 1 ed)) "* *")
                   (getstring "\nString Contains Spaces - Try Again...")
                   (setq ss nil)))
      (entmake (list (cons 0 "ATTDEF")
                     (assoc 8 ed)
                     (assoc 10 ed)
                     (assoc 11 ed)
                     (assoc 7 ed)
                     (assoc 40 ed)
                     (assoc 41 ed)
                     (assoc 50 ed)
                     (assoc 51 ed)
                     (cons 70 0)
                     (assoc 71 ed)
                     (assoc 72 ed)
                     (cons 74 (cdr (assoc 73 ed)))
                     (assoc 210 ed)
                     (cons 1 "")
                     (cons 2 (cdr (assoc 1 ed)))
                     (cons 3 (cdr (assoc 1 ed)))
                     (if (assoc 6 ed) (assoc 6 ed)'(6 . "BYLAYER"))
                     (if (assoc 39 ed) (assoc 39 ed)'(39 . 0))
                     (if (assoc 62 ed) (assoc 62 ed)'(62 . 256))))
      (entdel en)
      (redraw)
      (prin1))
    Instead of

    Code:
      (while (or (not ss)
                 (> (sslength ss) 1))
    Just curious

    Nice code by the way
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  9. #9
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,055

    Default

    Those parameters for ssget didn't come around until R14 or R15 and there were only 1 or 2 then. They have added more over the years.

    I think that they pretty cryptic looking where as AutoLISP is a fairly human readable language. 1 Reason I don't like vl and vla stuff. Way too long names for functions and not real readable. IMO. -David

    PS I just tried it 2000 and it didn't work as advertised
    R12 (Dos) - A2K

  10. #10
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Professional 64 bit
    Computer:
    HP EliteBook 8570w
    CPU:
    Intel Core i7-3720QM 2.60GHz
    RAM:
    16GB
    Graphics:
    NVIDIA Quadro K2000M
    Monitor:
    HP
    Discipline
    Civil
    Tiger's Discipline Details
    Occupation
    Education /support
    Discipline
    Civil
    Details
    Support/Education/Retail
    Using
    Civil 3D 2015
    Join Date
    Nov 2006
    Location
    Stockholm, Sweden
    Posts
    5,049

    Default

    Registered forum members do not see this ad.

    Just so you know guys, this is an old thread...

    but it's sould come in handy in future searches anyway
    whether is when you are asking yourself, should I stay or should I go
    weather is when it's cold as all that outside
    wether is a goat soprano
    #SpellingMatters

Similar Threads

  1. Keep text attribute in block at 0 degrees
    By neekcotrack in forum AutoCAD Drawing Management & Output
    Replies: 16
    Last Post: 28th Jul 2009, 06:59 pm
  2. Attribute text in blocks
    By feargt in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 1
    Last Post: 10th Oct 2008, 11:03 am
  3. Attribute Text Size
    By CAVINCA in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 16th Jan 2008, 02:49 pm
  4. Attribute text justification
    By paulmcz in forum AutoCAD General
    Replies: 6
    Last Post: 25th Feb 2007, 06:46 pm
  5. SHIFTED ATTRIBUTE TEXT
    By gollinsinc in forum AutoCAD Beginners' Area
    Replies: 0
    Last Post: 29th Aug 2005, 08:01 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