Jump to content
Lee Mac

Copy or Swap Text

Recommended Posts

Lee Mac

As posted over at theSwamp, I thought I'd post it here for you guys also :)

 

CopyText.lsp

 

CopyText.gif

 

SwapText.gif

 

The program will allow a user to copy the text content from a source object to a selection of destination objects or swap the text content between two objects. The user may select from Text, MText, Attribute, or Multileader objects.

 

Upon choosing 'Settings' the user can alter whether source object formatting should be retained upon copying/swapping to/with objects which permit the use of such formatting.

 

Ideas/criticism/feedback are, as always, welcome :)

 

Enjoy!

 

Lee

CopySwapTextV1-6.lsp

Edited by Lee Mac

Share this post


Link to post
Share on other sites
Lee Mac

I have completely rewritten this program to fix a number of bugs present in the previous version.

 

The new version may be downloaded from my site here, or from the first post of this thread.

 

Enjoy!

 

Lee

Share this post


Link to post
Share on other sites
pBe

Lee

 

Nice work as always.

 

Curios , How were you able to apply Color to Attributes? Multi-line or otherwise.

 

pBe

Share this post


Link to post
Share on other sites
Lee Mac
Lee

 

Nice work as always.

 

Thanks pBe :)

 

Curios , How were you able to apply Color to Attributes? Multi-line or otherwise.

 

The red & cyan colours were obtained using MText formatting codes applied to Multiline Attributes - or were you referring to something else?

Share this post


Link to post
Share on other sites
pBe

The red & cyan colours were obtained using MText formatting codes applied to Multiline Attributes - or were you referring to something else?

 

You are correct. Never did try to change the color of Multi-line Attributes manually, so i figured it cannot be done with lisp codes. But you sure showed me its doable :thumbsup: Cant say the same for regular attributes though

 

Thanks a mil LM :)

Share this post


Link to post
Share on other sites
Lee Mac

No worries! :)

Share this post


Link to post
Share on other sites
resullins

So no more double-clicking, ctrl+c, escape, double clicking, ctrl+v, escape? But that was SO much fun! Ha ha ha! Thanks Lee!

Share this post


Link to post
Share on other sites
hmsilva

Nicely done.

Thank you Lee!

 

 

Henrique

Share this post


Link to post
Share on other sites
Lee Mac
So no more double-clicking, ctrl+c, escape, double clicking, ctrl+v, escape? But that was SO much fun! Ha ha ha! Thanks Lee!

 

You can count on me to spoil your fun ;) :lol:

 

Enjoy resullins :)

Share this post


Link to post
Share on other sites
Lee Mac
Nicely done.

Thank you Lee!

 

Thanks Henrique!

Share this post


Link to post
Share on other sites
yohsuryak

doesn't work at autocad2015 lee :(

Share this post


Link to post
Share on other sites
ketxu
doesn't work at autocad2015 lee :(

 

Why you dont post your error message ^^ ?

Share this post


Link to post
Share on other sites
broncos15

Mine is working fine in 2015, so it might be a system setting. Also, Lee do you think it would be easy to do a check if the source and destination object is a dimension, and if so, allow it to copy it. Maybe something like this (this is part of my copy dimension program)?

(if (setq ss (LM:ssget "\nSelect destination dimensions:"
                                  '(((0 . "DIMENSION")))
                        )
               )
             (progn
               (setq obj (vlax-ename->vla-object ent)
                     cnt 0
               )
               (repeat (sslength ss)
                 (setq obj2 (vlax-ename->vla-object (ssname ss cnt)))
                 (vla-put-TextOverride obj2 (vla-get-TextOverride obj))
                 (setq cnt (+ cnt 1))
               )
             )
           )
           (setq whilestop nil)
          )

Share this post


Link to post
Share on other sites
BrianTFC

Why would you override your dimensions? it already allows you to copy a source dimension.

Share this post


Link to post
Share on other sites
broncos15
Why would you override your dimensions? it already allows you to copy a source dimension.
I have to override dimensions all the time. Many of my dimension have TYP., MIN., ESMT., after them. It kind of stinks to have to edit the text every time which is why I made my own routine so that I only have to do it once.

Share this post


Link to post
Share on other sites
Lee Mac

Many thanks for the feedback!

 

I have now updated this program to Version 1.5 to incorporate compatibility with Dimensions & MLeader Block Attributes.

Share this post


Link to post
Share on other sites
yathishkumar

Thank you very,very much sir. you have saved our lot of time for our all users.

Share this post


Link to post
Share on other sites
broncos15

Lee, thank you so much for this update, it is super useful and saves a ton of time. Do you happen to know why when I run it and copy from one dimension to another, I get Error: bad argument type: stringp nil and then it exits the while loop? It still will copy from one dimension to another, but you can only do it once.

Share this post


Link to post
Share on other sites
Lee Mac
Thank you very,very much sir. you have saved our lot of time for our all users.

Lee, thank you so much for this update, it is super useful and saves a ton of time.

 

You're welcome - I'm delighted that you both find the program so useful!

 

Do you happen to know why when I run it and copy from one dimension to another, I get Error: bad argument type: stringp nil and then it exits the while loop? It still will copy from one dimension to another, but you can only do it once.

 

After some testing, I can't seem to reproduce this error - are you able to upload an example drawing for which the program fails and describe the steps necessary to reproduce the error?

Share this post


Link to post
Share on other sites
broncos15

Lee, attached you will find a drawing in which it errors out on. Thank you so much for your help on this!

ctx-sample.dwg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...