+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Full Member
    Using
    AutoCAD 2010
    Join Date
    May 2012
    Posts
    25

    Default transform/replace object by text

    Registered forum members do not see this ad.

    hi,

    First of all, sorry for my poor english.

    I've joined a dwg files for a better comprehension of my "problem".

    http://www.grosfichiers.ch/index.php...osfichiers&cid[]=n0pp6olmgclaoei1cn2uko9dl4&task=resultat


    on this file you will see lot of objects (points in fact).

    I would like to replace them by text. just the number "1"

    I don"t want to give attributes, or modify the points.
    I just want to delete each point and replace it by a 1.

    I don't think there is a function to do it.

    I tried to write a lisp routine but i didn't succeed.

    Is there someone here who have allready develop a such routine?

    Thank in advance for your help

  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 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,058

    Default

    I'm pretty sure I've seen this question before, maybe asked in a slightly different manner, but I think one of the lisp gurus here came up with a solution via a custom routine. I'll have to search around and see if I can find the thread.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  3. #3
    Senior Member marko_ribar's Avatar
    Computer Details
    marko_ribar's Computer Details
    Operating System:
    Windows 7 Ultimate X64
    Computer:
    Intel quad core CPU 4x2.66GHz, 8GB RAM
    Motherboard:
    INTEL compatibile
    CPU:
    quad core 4x2.66GHz
    RAM:
    8GB
    Graphics:
    NVIDIA GeForce 6600 GT
    Primary Storage:
    250 GB
    Secondary Storage:
    500 GB
    Monitor:
    Samsung 17''
    Discipline
    Architectural
    marko_ribar's Discipline Details
    Occupation
    Architecture, project designer, project visualisation
    Discipline
    Architectural
    Details
    space design - modeling and animations
    Using
    AutoCAD 2012
    Join Date
    Feb 2010
    Location
    Belgrade, Serbia, Europe
    Posts
    328

    Default

    Code:
    (vl-load-com)
    (defun c:p2t ( / msp ss txtsize n entpt pt txt )
      (setq msp (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
      (while (not ss)
        (prompt "\nSelect points to replace with text \"1\"")
        (setq ss (ssget ":L" '((0 . "POINT"))))
      )
      (initget 7)
      (setq txtsize (getreal "\nInput text height : "))
      (repeat (setq n (sslength ss))
        (setq entpt (ssname ss (setq n (1- n))))
        (setq pt (cdr (assoc 10 (entget entpt))))
        (setq txt (vla-addtext msp "1" (vlax-3d-point pt) txtsize))
        (vla-put-alignment txt 10)
        (vla-put-textalignmentpoint txt (vlax-3d-point pt))
        (entdel entpt)
      )
      (princ)
    )
    M.R.

    Marko Ribar, d.i.a. (graduated engineer of architecture)
    M.R. on YouTube

  4. #4
    Full Member
    Using
    AutoCAD 2010
    Join Date
    May 2012
    Posts
    25

    Default

    Thanks a lot. It works perfectly

  5. #5
    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 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,058

    Default

    Registered forum members do not see this ad.

    I guess I can stop looking. That's pretty quick service there marko. guigol you should tell your friends to visit CADTutor.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

Similar Threads

  1. how to replace the from object (point) to object(donut)
    By RRS1987 in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 6th Oct 2011, 03:39 pm
  2. Copy and Replace Text of object.
    By pman860507 in forum AutoLISP, Visual LISP & DCL
    Replies: 55
    Last Post: 21st Sep 2011, 10:06 pm
  3. Routine to add modified text below existing text (copy/replace?)...
    By lamensterms in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 17th Jun 2011, 08:44 am
  4. replace an object (rectangle) with a named block and keep the hyperlink
    By Jaap Marchal in forum AutoLISP, Visual LISP & DCL
    Replies: 16
    Last Post: 12th Dec 2010, 05:56 pm
  5. Replace Text
    By viriato79 in forum AutoCAD General
    Replies: 5
    Last Post: 5th Aug 2009, 07:20 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