+ Reply to Thread
Page 1 of 7 1 2 3 ... LastLast
Results 1 to 10 of 70
  1. #1
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default CopyText.lsp: Copy/Swap Text/MText/Multileader/Attribute Values

    I've posted an older version of this in another thread, but I made some updates and wanted to 'officially' post it for everyone.

    Will allow allow user to select a 'source' Attribute/Multileader (with text)/Mtext/Text object, or "Type" in a text value, and copy its text contents to every selected 'target' Attribute/Multileader/Mtext/Text object.

    If only one 'target' object is selected, user is prompted with option to swap contents of 'source' and 'target' objects.

    Will work with and strip formatting of Multiline Attributes, if textstring is going to regular attribute or dtext.

    For selecting 'Target' text objects, user has option for single or "Multiple" selection (single will allow nested selection).

    For the "Type" option, don't forget to explore all the right-click menu options (import text, etc.).

    Pickfirst works for multiple text objects.

    Call with either CT or CopyText.

    Your comments are greatly appreciated.

    CopyText.gif

    Code:
    ;;; ------------------------------------------------------------------------
    ;;;    CopyText.lsp v1.3
    ;;;
    ;;;    Copyright© 03.16.09
    ;;;    Alan J. Thompson (alanjt)
    ;;;
    ;;;    Permission to use, copy, modify, and distribute this software
    ;;;    for any purpose and without fee is hereby granted, provided
    ;;;    that the above copyright notice appears in all copies and
    ;;;    that both that copyright notice and the limited warranty and
    ;;;    restricted rights notice below appear in all supporting
    ;;;    documentation.
    ;;;
    ;;;    The following program(s) are provided "as is" and with all faults.
    ;;;    Alan J. Thompson DOES NOT warrant that the operation of the program(s)
    ;;;    will be uninterrupted and/or error free.
    ;;;
    ;;;    User has option to copy contents of selected text object or typed in
    ;;;    content, to any number of selected text objects (Text, Mtext, Multileader,
    ;;;    Attribute Definition). If only one target object is selected,
    ;;;    user is prompted with option to swap contents of source & target.
    ;;;    Will select objects in xrefs & blocks.
    ;;;
    ;;;    Revision History:
    ;;;
    ;;;    v1.1    (06.08.09) 1. Rewrite to code after replacing/updating subroutines.
    ;;;
    ;;;    v1.2    (09.18.09) 1. Added function to, if applicable, strip formatting codes
    ;;;                  of textstring taken from MtextAttributes.
    ;;;               2. Removed issue with selecting Multileaders with blocks.
    ;;;               3. Added option to select multiple 'target' text objects.
    ;;;               4. Added option to type in text value to copy to others.
    ;;;               5. Added subroutines: AT:SS->List, AT:TabFilter, AT:EditTextBox
    ;;;
    ;;;    v1.21    (09.21.09) 1. Updated AT:EditTextBox subroutine.
    ;;;
    ;;;    v1.3    (11.25.09) 1. Added subroutine AT:TextString and changed string extraction
    ;;;                  coding to extract string from DXF code, ensuring that all
    ;;;                  symbols are extracted properly (bug with vla-get-textstring).
    ;;;
    ;;; ------------------------------------------------------------------------
    Updated: v1.21
    Updated: v1.3
    Attached Files
    Last edited by alanjt; 7th May 2012 at 07:28 pm.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  2. #2
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    264

    Default

    Quote Originally Posted by alanjt View Post
    I've posted an older version of this in another thread, but I made some updates and wanted to 'officially' post it for everyone.

    Will allow allow user to select a 'source' Attribute/Multileader (with text)/Mtext/Text object, or "Type" in a text value, and copy its text contents to every selected 'target' Attribute/Multileader/Mtext/Text object.

    If only one 'target' object is selected, user is prompted with option to swap contents of 'source' and 'target' objects.

    Will work with and strip formatting of Multiline Attributes, if textstring is going to regular attribute or dtext.

    For selecting 'Target' text objects, user has option for single or "Multiple" selection (single will allow nested selection).

    For the "Type" option, don't forget to explore all the right-click menu options (import text, etc.).

    Pickfirst works for multiple text objects.

    Call with either CT or CopyText.

    Your comments are greatly appreciated.

    Attachment 14444

    I am gonna check it out next monday at the office... I am using the old attribute version blocks here... but we'll need to use it if it works...

  3. #3
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    264

    Default

    Quote Originally Posted by gilsoto13 View Post
    I am gonna check it out next monday at the office... I am using the old attribute version blocks here... but we'll need to use it if it works...

    Yeaaaaa... it rocks...

    works with multiline attribute... I thought it was going to have some prompting , but it's clean... it copies text as required from attribute or mtext, or text, thanks a lot alan.

    This last weekend I had a very good progress on the blocks compilation thing... I just left only 4 collections to extract and check to start the final organizing. There are many good surprises, but I still can´t decide about some many blocks that have their original names, like stove01, tree01, door01... and keep them .. or standarize them all by their areas, and change all blocks to kitchen0001, vegetation0001, opening0001..

    Also, I am not sure if retain some layers or rename according to block area or change them all to layer 0 and color bylayer..

    Some comments would be appreciated for this too.
    Last edited by gilsoto13; 21st Sep 2009 at 05:43 pm.

  4. #4
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    Glad someone can get some use from it.
    Yeah, I didn't want the user to have any additional prompts. If I missed any formatting for Multiline Attributes, let me know.

    Quote Originally Posted by gilsoto13 View Post
    Yeaaaaa... it rocks...

    works with multiline attribute... I thought it was going to have some prompting , but it's clean... it copies text as required from attribute or mtext, or text, thanks a lot alan.

    This last weekend I had a very good progress on the blocks compilation thing... I just left only 4 collections to extract and check to start the final organizing. There are many good surprises, but I still can´t decide about some many blocks that have their original names, like stove01, tree01, door01... and keep them .. or standarize them all by their areas, and change all blocks to kitchen0001, vegetation0001, opening0001..

    Also, I am not sure if retain some layers or rename according to block area or change them all to layer 0 and color bylayer..

    Some comments would be appreciated for this too.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  5. #5
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    Updated (first post) edit box to appear at mouse location instead of center of screen.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  6. #6
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    264

    Default

    Hi, Alan


    Guess what?

    I think I found a much better routine for this... I already tested it with blocks and multiline attributes, it works with dims or any other kind....

    I think It's the one for everything at this the moment, (so It's just to help you in case you want to improve yours)

    http://www.asmitools.com/Files/Programs.html

    Quote Originally Posted by alanjt View Post
    I've posted an older version of this in another thread, but I made some updates and wanted to 'officially' post it for everyone.

    Will allow allow user to select a 'source' Attribute/Multileader (with text)/Mtext/Text object, or "Type" in a text value, and copy its text contents to every selected 'target' Attribute/Multileader/Mtext/Text object.

    If only one 'target' object is selected, user is prompted with option to swap contents of 'source' and 'target' objects.

    Will work with and strip formatting of Multiline Attributes, if textstring is going to regular attribute or dtext.

    For selecting 'Target' text objects, user has option for single or "Multiple" selection (single will allow nested selection).

    For the "Type" option, don't forget to explore all the right-click menu options (import text, etc.).

    Pickfirst works for multiple text objects.

    Call with either CT or CopyText.

    Your comments are greatly appreciated.

    Attachment 14444


    Updated: v1.21
    Attached Files

  7. #7
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    The only thing his will select that mine won't are Tables, and his will not select Multileaders, while mine will. I also have an option to multiple select several pieces of text at a time, import text, and swap. I'm not sure what I could do to mine, unless I'm missing something.


    Quote Originally Posted by gilsoto13 View Post
    Hi, Alan


    Guess what?

    I think I found a much better routine for this... I already tested it with blocks and multiline attributes, it works with dims or any other kind....

    I think It's the one for everything at this the moment, (so It's just to help you in case you want to improve yours)

    http://www.asmitools.com/Files/Programs.html
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  8. #8
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    264

    Default

    Quote Originally Posted by alanjt View Post
    The only thing his will select that mine won't are Tables, and his will not select Multileaders, while mine will. I also have an option to multiple select several pieces of text at a time, import text, and swap. I'm not sure what I could do to mine, unless I'm missing something.
    dimensions.... I was keeping an old lisp because it allowed to copy from dimensions to any dtext, mtext, att and dims, but not multiline attribute, now this one allows them all, but doesn´t allow a multiple selection option, I didn´t see your multiple option, even when it's partial cause won´t make it on multiple attributes, it's another option I didn´t see and it works... I guess I can keep both..

    nice

  9. #9
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    Quote Originally Posted by gilsoto13 View Post
    dimensions.... I was keeping an old lisp because it allowed to copy from dimensions to any dtext, mtext, att and dims, but not multiline attribute, now this one allows them all, but doesn´t allow a multiple selection option, I didn´t see your multiple option, even when it's partial cause won´t make it on multiple attributes, it's another option I didn´t see and it works... I guess I can keep both..

    nice
    Dimensions act like block in the respect that the Text can be selected via nested selection (nentsel). CopyText uses nentsel for both source and targets, so it will work with dimensions (except in multiple selection).

    I don't fully understand what you've said, so I can't fully address your comments. It has multiple selection (you have to activate it) and does work with multiline attributes (I made sure that option worked specifically because of you ).

    However, if there is some option you think would benefit CopyText, I would, for the most part, be more than happy to oblige. That's a big reason for posting these routines; while, they have the potential to benefit others, it also gives me an opportunity to get improvement ideas from others.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  10. #10
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    Registered forum members do not see this ad.

    Updated to account for a bug in vla-get-textstring, which will not extract symbols, instead a "?" is given.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

Similar Threads

  1. Creating tool (lisp) for copy attribute and global attribute edit
    By MarcoW in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 14th May 2009, 10:41 am
  2. [FIELDS] Copy value of attribute text.
    By OMEGA-ThundeR in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 14th Apr 2009, 07:30 am
  3. Copy and paste with different z-values
    By Siberian in forum AutoCAD General
    Replies: 11
    Last Post: 26th Oct 2007, 05:46 pm
  4. Text Values from Attribute Tags from Exploded Block Inserts?.
    By muck in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 12th Oct 2007, 03:53 pm
  5. Explode Block Objects by Keeping Attribute Text Values
    By Harun KILIC in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 8th Apr 2007, 09:39 am

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