Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copy text or line then change its color to green

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
539 Views, 3 Replies

Copy text or line then change its color to green

Hi everyone,

I'm looking for a way to copy a text or a simple line, circle... ; after I copied it, the last entity change its color to green.

Thank you for helping.

3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:
...

I'm looking for a way to copy a text or a simple line, circle... ; after I copied it, the last entity change its color to green.

....


The down-and-dirty simplest way would be something like this, in AutoLISP terms:

 

(command

  "_.copy" pause "" pause pause

  "_.chprop" "_last" "" "_color" 3 ""

); end command

 

Or, in menu macro terms:

 

^C^CCOPY \;\\CHPROP L ;C 3 ;

 

That approach depends on the User not missing when they pick something, and on its not being on a locked Layer, and on the User not needing to do something like enter an Object-snap mode for one of the copy points, and so on.  And it can only do one object, not a multiple-object selection.  Something could be made that's much more sophisticated to overcome all those limitations.

Kent Cooper, AIA
Message 3 of 4
Anonymous
in reply to: Kent1Cooper

It's working good.

Thank you Kent1Cooper

Message 4 of 4
Kent1Cooper
in reply to: Anonymous

You're welcome -- that was a comparatively easy one.  For examples of some of the sophistications that can be introduced, see any number of routines on this forum, for example, OffsetToLayer.lsp here.  It does some of the things you might want to do [e.g. checks for locked Layer], and some things you might or might not [e.g. allows only certain entity types], and some you definitely don't need here [e.g. saves choices and offers them as defaults on later use].  But given something it can work with, it ends up using the same CHPROP command, though it applies a different option.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost