Announcements
IMPORTANT. Forum to be archived in several phases. You can no longer submit new questions - but can only answer existing threads until Oct 17th 2016. Please read this message for details
Mechanical Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set color to Layer & freeze

4 REPLIES 4
Reply
Message 1 of 5
jstarr-kimastle
218 Views, 4 Replies

Set color to Layer & freeze

I'm trying to write a lisp routine where I can click on an item (all I get are ASSURFACE to work with) and it pulls the color off that item. Then it needs to select all entities with that color to a certain layer (I've been using DATA_01, DATA_02, etc.). Then I want to freeze that layer.

The problem I'm having is the select by color and set that group to a layer.

If you can help me I'd appreciate it. I'm using MDT 2007.

Here's what I have so far:
(DEFUN C:S1 ()
(COMMAND "UNDO" "M")
(PRINC "\nSELECT THE COLOR YOU WANT TO PUT ON LAYER DATA_01... ")
(SETQ GROUP (SSGET)); <-- I think I need help here
(COMMAND "CHPROP" GROUP "" "LA" "DATA_01" "")
(COMMAND "-LAYER" "F" "DATA_01" "")
(PRINC "\nTHESE ITEMS HAVE BEEN PUT ON LAYER DATA_01.")
(PRINC)
)

Thanks again,

Jason
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: jstarr-kimastle

Maybe something in this lisp may help you.
Message 3 of 5

I've looked over the AMCOLOR.LSP and it looks like it sets a variable mycolor to 256 but I'm still not sure how to get all of a certain color by just picking an entity (in this case an ASSURFACE). This probably seems really easy to you but I'm lost. I know the property is set to 62.
The line is going to look something like this, right?
(setq group (ssget '(62 . XXX ) ) )
Once I get them I know how to set them to the DATA_01 layer and then freeze it.

This is frustrating. I feel like I'm really close to the answer.

J
Message 4 of 5
Anonymous
in reply to: jstarr-kimastle

Try reposting in the AutoCAD customization newsgroup. That should be a
pretty easy lisp for someone there to write.
Message 5 of 5

Thanks, I'll do that.

J

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

Post to forums