Registered forum members do not see this ad.
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.
Updated: v1.21Code:;;; ------------------------------------------------------------------------ ;;; 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). ;;; ;;; ------------------------------------------------------------------------
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.
Updated (first post) edit box to appear at mouse location instead of center of screen.
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)
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.
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.
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.