×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to seperate layers by colour?
2

How to seperate layers by colour?

How to seperate layers by colour?

(OP)
Hey,

Have this problem. Im using ACAD 14 at the office.

My new draftman keeps commiting the mistake of using only one or two layer and merely chnaging the colours of these layers when drawing different parts of a plan (eg. door=cyan, wall=red, column=green but all on layer=wall).

This makes it really difficult when im rediting the drawings, cus when i turn of one of the layers many of the objects of various colours are turned off as well.

1. Is there a way of separating the colours into different layers without manually clicking each object?
2. Can i just switch off a particular colour and not the whole layer?

Thanks

Daniel

RE: How to seperate layers by colour?

2
hi
I usually have this problem
I will solve this problem in next few days by lisp routine
I suppose make some separate layers
ex: door is orginal layer and color bylayer is yellow
so red color in layer door1
   cyan color in layer door4

Do you have any advice?

RE: How to seperate layers by colour?

Have your draftsman copy all the same colors on to a separate layer on his own time. Chances are your problem will be soon sovled.

RE: How to seperate layers by colour?

Go Ralph!
I think cad123 can solve your problem with
a lisp routine by searching on the color
regardless of layer.  I did enjoy Ralph's
answer.  It sounds like you have a serious
communication problem with your employees
or coworkers.  If you explain why you think
it is important that your procedure be followed,
I think it will be adopted joyously by the drafter.

RE: How to seperate layers by colour?

(OP)
Hey guys,

Thanks for the replies. Yeah i've been telling him too many times, its just that he's kinda unfamilar with the proper usage of the program and the english language to i guess. ;P

Ummm and now one more kinda embarassing question, can someone please tell me everything i need to know about lisp routines etc. I am totally unfamiliar with it. Everything about it ;)

Thanks  

RE: How to seperate layers by colour?

Autolisp files are automatic command files that
can be run in acad with the load command.
Like (load"xxxx") where xxxx.lsp is the actual
autolisp file and in your acad directory else
you have to list something like (load"c:/acad/xxxx")
where the xxxx.lps file resides.  The backslash is
correct as shown.  In dos it would have been a forward
slash, but in acad it must be the opposite.
After the command is executed, you can type xxxx or
whatever the name of the lisp file is and it will
run.  You might search and see if there any lisp files
in you acad directory and try loading them just to
get some idea of how to use them.  They are active
as a command file unless you exit acad.  
If you must do your layer change command manually for
the layer change.  I would turn the layer off that
you want to change the items to and the using the
change command and select the items and have them
disappear until you are done and then turn that layer
back on.  I hope this was clear.  

RE: How to seperate layers by colour?

hi
I post my lisp here. can you have a look and give some comment to improve it. I feel it's speed a litle slow.

type appload in command and choice this file
;----------------------
;SEP.lsp This program use to separate  layer with colour not bylayer
;Made by cad123, 1 Dec 02
 (princ "\nType SEP to start")
(defun C:sep()
   
    (setq e(car(entsel "Pick On Grounp Layer To select:\n" )))
    (setq e(entget e))
    (setq n(cdr(assoc 8 e)))
    (setq nn(ssget "x" (list(cons 8 n))))
    (princ "\n Wait few minutes")
    (princ " ")
    (command "select" nn  "")
  
          
    (setq co 1)
    (while (< co 256)
      (setq ss (ssget "x" (list (cons 8 n)(cons 62 co))))
         (if (null ss) (setq co (1+ co))
    (progn
      (setq cname (itoa co))
      (setq lname(strcat  n cname))
      (command ".layer" "m" lname "c" co "" "")
      (command ".chprop" ss ""
           "C" "bylayer" "la" lname "")
        );end progn
    );end if
      );end while


  )
;-----------------------------------
Enjoy it

RE: How to seperate layers by colour?

(OP)
Hey Cad,

Im sorry but i don't know what to do with this set of codes, How do i use it?

Thanks

RE: How to seperate layers by colour?

hi daniel
Just copy between
;------
;SEP.lsp This program use to separate  layer with colour not bylayer
;Made by cad123, 1 Dec 02
 (princ "\nType SEP to start")
--------------------
-------------------
);end while
  )
;-------

and name it : sep.lsp ( you can use notepad)
after that use appload command and load this file ( sep.lsp)
( if you want know clearly you should go to help and find down what you don't know )
Hope you will do,

RE: How to seperate layers by colour?

Another method to try ...
It's not that fancy like the LISP but it's still effective.
(A poor man's method)

Type FILTER
sort/ select by color

Setup a selection set by color
Once you do that ....
Run the filter to select objects by color
Once the objects are selected ... simply pull down the layers from the standard toolbar ... and the objects SHOULD MOVE TO THAT LAYER!

Repeat the step over and over until you're done!

It ain't fancy but it should get the work done quickly.

Later.
Rich

RE: How to seperate layers by colour?

another way to select everything in the drawing of one color is by using "quick select" (in 2002)
One thing to remember when using this though is that if you are selecting everything that is color "red" it won't select itmes that are color "bylayer" even if they happen to be red because of what layer they are on.  
Does that make sense?

RE: How to seperate layers by colour?

(OP)
Hey

Thanks for all the tips....... they works .... thansk a mil!

Cad: How do you write these lisps? Do you need a special programe? Any tutorial on the net? Where can I get more lisps?

Thanks again!

RE: How to seperate layers by colour?

hi daniel
I use Visual lisp program( but I only research Autolisp). This works very well and this program include AutoCad from 2000 up. And lisp have a lot of website but ;) good lisp not free. So if you want learn it , you should use a book in your language, I study by myself too.
If you want learn online I show one site:
http://pw1.netcom.com/~rogh/autolisp/

Hope you will become a expert.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources