+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Forum Newbie
    Using
    AutoCAD LT 2009
    Join Date
    Oct 2014
    Posts
    3

    Unhappy Replace specific text with closest mtext

    Registered forum members do not see this ad.

    Hello guys,

    I have a drawing where someone used mtext as names for specific blocks, I need to extract the coordinates for those blocks but the mtext base point is not where the block base point is.
    Therefore I just put an attribute definition with the " * " sign and I have to manually replace it with the mtext number., so I can later use eattext to extract coordinates.
    Since I have a huge number of those symbols (around a thousand in the drawing) I was hoping if there is a lisp that would replace the * with the closes mtext content.

    I'm attaching an example of what I have in the drawing, basically the * needs to change to 4885.
    Is there a lisp that does something like that?

    Thx.

    damn.dwg

  2. #2
    Forum Newbie
    Discipline
    Architectural
    Using
    AutoCAD 2015
    Join Date
    Nov 2017
    Posts
    4

    Default

    i don't know if it will help you,
    but lee-mac have a lisp to change the base point of a bloc without moving the block? http://www.lee-mac.com/changeblockinsertion.html

  3. #3
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,795

    Default

    I have moved your thread to the AutoLISP, Visual LISP & DCL Forum.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  4. #4
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    528

    Default

    If you're using AutoCAD LT like your profile shows, then you can't use lisp.

  5. #5
    Forum Newbie
    Using
    AutoCAD LT 2009
    Join Date
    Oct 2014
    Posts
    3

    Default

    @Bibix
    yeah I know about that one, unfortunately it's no help...

    @SLW210
    thank you, sorry about that, my bad

    @ronjonp
    no ron I'm on a full version, never mind about the profile

  6. #6
    Forum Newbie
    Using
    AutoCAD LT 2009
    Join Date
    Oct 2014
    Posts
    3

    Default

    I've found this useful script that let's me copy(or swap) text which would also help me, it's a solution where I will have to do a huge number of clicks but again shorter than clicking at least twice to edit each * sign
    The only problem with this script is that it keeps repeating the text you originally selected, I would need one that asks for input after it has done one copy/swap
    http://www.lee-mac.com/copytext.html

  7. #7
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,815

    Default

    Registered forum members do not see this ad.

    I think the best thing to do is to redo the #ptnum block over again including the attribute. You can make attributes visible or not so could have ptnum turn off.

    How did you get the pts in the first place was it a csv file P,N,E,Z,D etc even with LT you can do some pretty detailed stuff in excel that would fix this problem so the Block and mtext are correctly related.

    In civil software this is common and in CIV3d you have styles to do this.

    Lastly you could cross relate the block insertion point to the mtext insertion pt via a max distance and redo the mtext at correct ins pt, lower left, right justified etc. But sorry not about to spend a lot of time trying to retro it. Move forward and fix for next time. Steven-g may have something he is a wiz at Excel & LT.
    A man who never made mistakes never made anything

Similar Threads

  1. replace prompt with select all (mtext)
    By jt6572 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 23rd Mar 2017, 12:16 am
  2. How to replace a MTEXT of an attribute
    By LauKwokFai in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 16th Mar 2017, 08:24 am
  3. Replies: 16
    Last Post: 17th Jan 2015, 08:05 am
  4. LISP - Do routine if specific text is found in a specific block attribute
    By h0okem in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 19th Nov 2011, 05:53 am
  5. How to find all mtext which is using a specific text style?
    By salmonrose in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 3rd Feb 2010, 06:27 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