Layer property filters in AutoCAD



Author Erhan Toker
Profession Architect M.Sc.
  Autodesk Authorized Consultant
  Software Specialist
e-mail  

Autocad 2007 and higher versions

Fig.1
Fig. 1 – Layer Properties Manager.

If you have this much of layers in your drawings, it is very difficult to choose the one that we will work on it among them. For this reason, AutoCAD has introduced property filters in layers window.

However, as usual I will assume that you have paid attention in naming layers while you work with them. In this list, you can see the layers created by a software that is prepared by our company. Prefix assigned to our company by AutoDESK is ‘TAL_’. So that’s why we are starting all the names of layers that we use in our programs with ‘TAL_’. By doing this, we are eliminating all the possible naming coincidences with layers that may be created by other software or the user. After the prefix, there is “2D/3D” part which shows that whether the layer belongs to a 2D or 3D drawing entity. The remaining part shows which module the layer is related to. Due to the fact that we have also assigned render material to layers, they start with ‘TAL_3D_RENDER_’. After explaining about our layer naming system shortly, let’s move on to the filter management window. First of all, I would like to remind you that the window shown in Fig. 1 is activated by LAYER command. The list that is on the left half of this window is reserved for filters. Let’s quickly create a new filter.

Fig.2
Fig. 2 – New property filter command.

By the help of button, seen in Fig. 2, let’s create our first layer property filter. As soon as we press this button, a new window shown in Fig. 3 will open up.

Fig.3
Fig.3 – Layer property filter definition window.

Each filter shall have a name. As we will list 2D layers in our first filter, I am selecting its name as ‘2D’ also. You can filter all of the layers according to all of their properties. In this context, due to the fact that we are only dealing with the name, we write ‘TAL_2D_*’ in the cell under ‘Name’. ‘*’ character is used as joker character in AutoCAD and means everything. In this case, we can see all of the layers starting with TAL_2D_. Anyway, you will already see only the 2D layers in the ‘Filter Preview’ window as soon as you write it. You have already noticed that, we can put more than one line in the definition of filter. In such cases, there is –AND- logical relationship between the lines, i.e. as if saying “list all the layers having conditions in 1st line and 2nd line”. For now, let’s close this window by saying OK, and prepare another filter similarly for 3D layers. Name of this filter will be ‘3D’ and its filter name will be ‘TAL_3D_*’. Finally, let’s create another one with ‘Render’ name and ‘TAL_3D_RENDER_*’ filter name.

Fig.4
Fig. 4 – While the filters are working.
2
Now, the layer properties manager should look like as shown in Fig. 4. However, when we choose ‘3D’, layers related to render are also listed. This will make our work harder. For this reason, let’s right click on ‘3D’ filter and select ‘Properties…’ and let’s enter the filter definition again. (Fig. 5)

Fig.5
Fig.5 .

By the modification we have done in the filter name, we specified that we want to choose all of the 3D layers that start with TAL_3D_ but just after that does not include –R- letter. When we return back to the layer control window, we will see that we have almost made this list clear. Finally, let me list special characters that are used for name catching:

Table.1
Table 1 - Joker character list.

Thats all. Hope see you again :)

Technorati Tags: , ,

Similar Posts

Rate this article:

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

15 Responses to “Layer property filters in AutoCAD

  • 1
    arjun
    July 1st, 2007 16:31

    thank you very much. i now understood how to use layer effectively

  • 2
    Agnes Tsen
    September 13th, 2007 07:03

    Dear Sirs,

    I am new learner of Autocad. I didn’t understand the command of “EX WALL”. Kindly advice.

    TQ

  • 3
    Erhan Toker
    September 13th, 2007 09:35

    Hello Agnes
    I did not heard about that command. AutoCAD commands can not have SPACES. So “EX WALL” can not be an AutoCAD command. What’s your AutoCAD version? Is it AutoCAD or Architectural Desktop?

  • 4
    Daily Autocad » Blog Archive » Hint: Use layers when modelling in 3D!
    November 30th, 2007 10:32

    [...] Layer property filters [...]

  • 5
    junes
    January 31st, 2008 09:23

    Before reading this tutorial when i was opening layer manager of some big projects i noticed filter but i didn’t know its application, thank you very much.

  • 6
    amir
    February 7th, 2008 00:34

    thanks for the informative chart, but i have one question,

    how can i create a filter that shows all layers that do not have the character strings “ABC” and do not also have “123″ for example

  • 7
    Daily Autocad » Blog Archive » Layers 3
    April 17th, 2008 09:46

    [...] Filters can be formed in the left part of the window. Tha main part is designed for layer list and properties. The more layers are created the more the list gets complicated. Thus using the filters may become very useful. To understand filtering, please refer to relevant articles. Let us now examine the commands in the window (Figure 2). [...]

  • 8
    phyo
    June 9th, 2008 10:11

    Thank U.
    But I have a question.
    How do I pay a lot of layer names in my plan drawing?

  • 9
    Ken
    August 16th, 2008 21:46

    Since I installed Windows Vista, I cannot change the layer properties in AutoCAD 2007 with SP2 installed (and not SP1). Is there a fix for this?

  • 10
    Erhan Toker
    August 18th, 2008 09:12

    Hello Ken,
    According to AutoDESK, there is no problem with Vista if you installed SP2 on 2007. We’re not using Vista. I cannot reproduce the error. But you can write it to support center. They will help you.

  • 11
    Erhan Toker
    August 18th, 2008 09:12

    Hello Ken,
    According to AutoDESK, there is no problem with Vista if you installed SP2 on 2007. We’re not using Vista. I cannot reproduce the error. But you can write it to support center. They will help you.

  • 12
    JAY
    August 25th, 2008 06:42

    hai,

    In xref i switch off the layer but the drawing cannot switch off.how i switch off in xref dwg.
    Thanks

  • 13
    Erhan Toker
    August 28th, 2008 11:02

    Hello Jay,

    AutoCAD creates new layers for attached XREFS. Naming method is like this : {xreffed dwg file name}|{LAYERNAME} . So you have to make modification on this layers.

    Hope this helps

  • 14
    daren llamado
    September 22nd, 2008 05:37

    hi,

    Just want to share to you guys my lisp for checking layers 1 by 1.

    ; The following program is sample output from the LISP Generator (more info at http://www.LispGen.com).
    ; The LISP Generator is a full-featured code generator for Autocad’s AuotLISP language.
    ; Legal notices:
    ; - This sample program is intended as a demonstration only.
    ; - The program is available on an ‘as-is’ basis with no warranties, either expressed or implied, of any kind.
    ; - The program may only be used at the user’s own risk.
    ; - No license or rights to the code are either given or forfeited.
    ; Everything that follows is direct and unaltered output from the LISP Generator.

    ; This program was created on November 22 2006 using the LISP Generator.

    ; Define the function (the program).
    (defun c:CL ( / ENTITY1 LN OLDCE OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar “cmdecho”))
    (setvar “cmdecho” 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar “texteval”))
    (setvar “texteval” 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat “\nExecution of CL halted by the following error: ” ERRMES))
    (setvar “cmdecho” OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in ENTITY1.
    (setq ENTITY1 (car (entsel “\nSelect object from which to extract the layer: “)))

    ; EXTRACT the Layer name from the entity ENTITY1 and store it in LN.
    (setq LN (cdr (assoc 8 (entget ENTITY1))))

    ; Input to AutoCAD’s command line.
    (command
    “change”
    )
    (command
    (ssget)
    “”
    “p”
    “la”
    LN
    “”
    )

    ; Reset “cmdecho” to previous value.
    (setvar “cmdecho” OLDCE)
    ; Reset “texteval” to previous value.
    (setvar “texteval” OLDTE)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

  • 15
    Koray Kaya
    September 22nd, 2008 21:08

    Erhan Bey,
    Sadece paylasiminiz icin tesekkur etmek istedim

Leave a Reply