Layer filter for Used layers NOT in xrefs?

Layer filter for Used layers NOT in xrefs?

MbMinx
Enthusiast Enthusiast
3,774 Views
12 Replies
Message 1 of 13

Layer filter for Used layers NOT in xrefs?

MbMinx
Enthusiast
Enthusiast

I apologize if there is a post for this already. My search mojo has been failing me recently.

I have a layer properties filter for "All used layers" and for "All non-Xref layers". No, I'm not sure where they came from...What I WANT is a filter for "All used, non-Xref layers". I know how to filter for used layers, but I don't know how to filter out the Xrefs.

Thank you.

MaryB

C3D 2020

0 Likes
Accepted solutions (1)
3,775 Views
12 Replies
Replies (12)
Message 2 of 13

pendean
Community Legend
Community Legend
You can just make your own, here is an easy to follow tutorial https://cadsetterout.com/autocad-tutorials/take-charge-of-autocad-with-layer-filters/

0 Likes
Message 3 of 13

natasha.l
Alumni
Alumni

Hello @MbMinx

 

Depending on the xref method used to link with your primary file your layers will be organized this way. It seems you may want to utilize Grouping Layers maybe then freeze/turn off that group. 

 

Please "Accept Solution" if a reply or replies have helped resolve the issue or answered your question, to help others in the community.

0 Likes
Message 4 of 13

MbMinx
Enthusiast
Enthusiast
No, that doesn't sound like it to me.

Our template drawing has a lot of layers pre-created for us. It's a lot of
layers... Then I attach xrefs, and all those layers show up in my layer
manager as well. And I'm looking at a list of hundreds and hundreds of
layers.

I tend to do my work in about a dozen layers, and I switch back and forth
across them as I do my thing. I want a filter in the layer manager so that
it will only show me a list of the layers used in my active file. That
would be a very short list, and I wouldn't have to keep scrolling up and
down to get what I want.

I can see a filter for all used layers, which includes all of the layers
used in all the xrefs...I can see a filter for all non-xref layers, which
shows me every layer in my active file. I can't figure out how to make a
filter so that the layer manager will only show me the layers in my active
file that have been used. This isn't a static group - it should change on
the fly as I add and delete elements as I go along.

Or is there a way I can sort the layer manager so that the used, active
file levels are first in the list?

MaryB
0 Likes
Message 5 of 13

vinodkl
Mentor
Mentor

You can create a New Group Filter and add the objects which you will be working on. Below screencast shows how its done.

 

 

 

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
0 Likes
Message 6 of 13

MbMinx
Enthusiast
Enthusiast

I can do that, but I don't see which property can be selected to determine whether the layer is in the active file, or in an xref (any xref).

0 Likes
Message 7 of 13

MbMinx
Enthusiast
Enthusiast

I don't want a static group of elements, just like I don't want a static group of layers.

I want a layer filter so that when I look at my layer manager (or my list of layers on the ribbon) I only see the ones I am working with, and none of the others.

 

I want a layer filter so that the list of layers shown in the layer manager can be dynamic as I keep working. If I draw something onto a new layer, I want that layer to be included in the list automatically. If I attach a new xref, I want those levels to be excluded from the list automatically. And if I need to see those other layers, I can just select a different filter.

 

I'm not interested in the display of elements. I'm interested in paring down the list of layers I see in my layer manager. I'm coming over from another software package, and this doesn't SEEM like it should be this big a deal.

0 Likes
Message 8 of 13

vinodkl
Mentor
Mentor

I guess your not ready to try out any of suggestion offered to you. Without trying out any of the suggestion your just replying back. Once you create a group filter and make that as current it will only display those layers in the ribbon. When someone offers assistance you should make sure you try and then reply back. Cause we people are being paid over here to offer you assistance.

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
0 Likes
Message 9 of 13

MbMinx
Enthusiast
Enthusiast

I HAVE tried that, and that's why I'm asking about PROPERTY filters.

All of the GROUP filters I have generated have been static. New layers that I use do not get added in automatically. The group is only what I selected at that point in time. I want to use properties so that the layers on the list will adjust automatically as I work along.

 

Or is there a setting that makes a group filter dynamic?

0 Likes
Message 10 of 13

GrantsPirate
Mentor
Mentor
Accepted solution

You can use ~*|* to set that up.

I use a lisp file that I got somewhere on the internet to set that for me.

(defun C:XREFNOT ( / xdict dict xrecname )
 (vl-load-com)
    (setq xdict
        (vlax-vla-object->ename
            (vla-getextensiondictionary 
                (vla-get-layers 
                    (vla-get-activedocument (vlax-get-acad-object))
                )
            )
        )    
    )
    
    (setq dict
        (if (setq dict (dictsearch xdict "ACAD_LAYERFILTERS"))
            (cdr (assoc -1 dict))
            (dictadd xdict "ACAD_LAYERFILTERS"
                (entmakex
                   '(
                        (0 . "dictionary")
                        (100 . "AcDbDictionary")
                        (280 . 0)
                        (281 . 1)
                    )
                )
            )
        )
    )
    
    (princ
        (if (dictsearch dict (setq xrecname "No_Xref_Layers"))
            (strcat
                "Layer filter named <"
                xrecname
                "> already exists."
            )
            (if
                (dictadd dict xrecname
                    (entmakex
                        (append
                           '(
                                (0 . "xrecord")
                                (100 . "AcDbXrecord")
                                (280 . 1)
                            )    
                            (list (cons 1 xrecname))
                           '(
                                (1 . "~*|*")
                                (1 . "*")
                                (1 . "*")
                                (70 . 0)
                                (1 . "*")
                                (1 . "*")
                                (-3          
                                    (   "ACAD"
                                        (1000 . "( NAME== \"~*|*\" )")
                                    )         
                                )
                            )    
                        )
                    )
                )
                (strcat
                    "Created layer filter named <"
                    xrecname
                    ">."
                )
                "Doh! Something horrible happened. "
            )    
        )    
    )    
  
    (princ)
 
) 

GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

0 Likes
Message 11 of 13

ВeekeeCZ
Consultant
Consultant

There is really simple no-customization solution. Actually simpler than I thought.

 

Go to the Layers, Layer Setting, make sure that "Indicate Layers In Use" toggle is ticked.

Then create new layer PROPERTY filter by selecting correct status - Used non-Xref Layer.

 

See described process HERE 

 

Then we could ask @natasha.l to move this topic back to the general AutoCAD forums.

Message 12 of 13

ВeekeeCZ
Consultant
Consultant

@ВeekeeCZ wrote:

There is really simple no-customization solution. Actually simpler than I thought.

 

Go to the Layers, Layer Setting, make sure that "Indicate Layers In Use" toggle is ticked.

Then create new layer PROPERTY filter by selecting correct status - Used non-Xref Layer.

 

See described process HERE 

 

Then we could ask @natasha.l to move this topic back to the general AutoCAD forums.


 

Well, I was wrong... not simpler as I thought. Filtering just by status isn't probably enough (more info about status icons HERE ). We still need to exclude xref layers by their names:

 

~*|*

 

image.png

0 Likes
Message 13 of 13

c.haynes-BM
Participant
Participant

A single line item that can be used in .scr Scripts

 

(command "-LAYER" "filter" "N" "P" "All" "NAME==\"~*|*\"" "All Non-Xref Layers" "x" "")

Source & Credit: https://cadtips.cadalyst.com/layer-tools/create-filter-all-layers-except-xref-layer