Layer Filter Delete...case-sensitive??

Discussion in 'AutoCAD' started by Matt W, Sep 16, 2004.

  1. Matt W

    Matt W Guest

    Just an FYI:

    Using the following code to remove Layer Properties Filters, I've noticed
    something kinda quirky.
    On some of my drawings (mainly Land Desktop and Building Systems, both
    2005), it didn't work.
    HOWEVER, if I changed AcLyDictionary to ACLYDICTIONARY (all caps) then it
    works (same thing for the LSP equivalent that R Bell has posted before).

    I didn't realize it was case sensitive??!?

    Sub LayerFilterDelete()
    Dim objDict As AcadDictionary
    Dim objRec As AcadObject
    If ThisDrawing.Layers.HasExtensionDictionary Then
    Set objDict = ThisDrawing.Layers.GetExtensionDictionary
    For Each objRec In objDict
    If (objRec.Name = "ACAD_LAYERFILTERS") Or _
    (objRec.Name = "AcLyDictionary") Then objDict.Remove
    objRec.Name
    Next
    End If
    End Sub
     
    Matt W, Sep 16, 2004
    #1
  2. Matt W

    Matt W Guest

    Okay... now I'm totally confused.
    I took a look at the Acad Database using DBVIEW and prior to running the
    layer filter delete program, ACLYDICTIONARY did NOT exist. But if I
    manually deleted the layer filters, then opened DBVIEW again to take a look,
    ACLYDICTIONARY shows up. (Maybe it's NOT case-sensitive)

    So now my question is, what need's to be initiated before the program can be
    run?? We've found this to be an invaluable tool since we're constantly
    dealing with drawings from people who, let's face it, don't know how to
    clean up after themselves. In one drawing alone, I've deleted 13,500 layer
    filters (that's not a typo). You can just imagine how long it took to
    display the layer properties manager!!

    --
    I love deadlines
    I like the whooshing sound they make as they fly by.

    | Just an FYI:
    |
    | Using the following code to remove Layer Properties Filters, I've noticed
    | something kinda quirky.
    | On some of my drawings (mainly Land Desktop and Building Systems, both
    | 2005), it didn't work.
    | HOWEVER, if I changed AcLyDictionary to ACLYDICTIONARY (all caps) then it
    | works (same thing for the LSP equivalent that R Bell has posted before).
    |
    | I didn't realize it was case sensitive??!?
    |
    | Sub LayerFilterDelete()
    | Dim objDict As AcadDictionary
    | Dim objRec As AcadObject
    | If ThisDrawing.Layers.HasExtensionDictionary Then
    | Set objDict = ThisDrawing.Layers.GetExtensionDictionary
    | For Each objRec In objDict
    | If (objRec.Name = "ACAD_LAYERFILTERS") Or _
    | (objRec.Name = "AcLyDictionary") Then objDict.Remove
    | objRec.Name
    | Next
    | End If
    | End Sub
    |
    | --
    | I love deadlines
    | I like the whooshing sound they make as they fly by.
    |
    |
    |
     
    Matt W, Sep 16, 2004
    #2
  3. Matt W

    Jeff Mishler Guest

    I have no idea why it does what it does, as I don't have 2005 to experiment
    with. However, couldn't you just change the code to this to take care of and
    case-sensitivity?

    If (Ucase(objRec.Name) = "ACAD_LAYERFILTERS") Or _
    (Ucase(objRec.Name) = "ACLYDICTIONARY") Then objDict.Remove
     
    Jeff Mishler, Sep 16, 2004
    #3
  4. Matt W

    Matt W Guest

    Absolutely I could do that, but what baffles me is, why doesn't
    AcLyDictionary exist when I open a drawing?? I've got a ton of layer
    filters that need to be deleted, but they won't because that particular
    dictionary doesn't even exist!!

    Do I need to create it first to initialize something going on behind the
    scenes before I can delete it??!?

    (I think my head's going to explode this morning)

    --
    I love deadlines
    I like the whooshing sound they make as they fly by.

    | I have no idea why it does what it does, as I don't have 2005 to
    experiment
    | with. However, couldn't you just change the code to this to take care of
    and
    | case-sensitivity?
    |
    | If (Ucase(objRec.Name) = "ACAD_LAYERFILTERS") Or _
    | (Ucase(objRec.Name) = "ACLYDICTIONARY") Then objDict.Remove
    |
    | --
    | Jeff
    | check out www.cadvault.com
    | | > Okay... now I'm totally confused.
    | > I took a look at the Acad Database using DBVIEW and prior to running the
    | > layer filter delete program, ACLYDICTIONARY did NOT exist. But if I
    | > manually deleted the layer filters, then opened DBVIEW again to take a
    | > look,
    | > ACLYDICTIONARY shows up. (Maybe it's NOT case-sensitive)
    | >
    | > So now my question is, what need's to be initiated before the program
    can
    | > be
    | > run?? We've found this to be an invaluable tool since we're constantly
    | > dealing with drawings from people who, let's face it, don't know how to
    | > clean up after themselves. In one drawing alone, I've deleted 13,500
    | > layer
    | > filters (that's not a typo). You can just imagine how long it took to
    | > display the layer properties manager!!
    | >
    | > --
    | > I love deadlines
    | > I like the whooshing sound they make as they fly by.
    | >
    | > | > | Just an FYI:
    | > |
    | > | Using the following code to remove Layer Properties Filters, I've
    | > noticed
    | > | something kinda quirky.
    | > | On some of my drawings (mainly Land Desktop and Building Systems, both
    | > | 2005), it didn't work.
    | > | HOWEVER, if I changed AcLyDictionary to ACLYDICTIONARY (all caps) then
    | > it
    | > | works (same thing for the LSP equivalent that R Bell has posted
    before).
    | > |
    | > | I didn't realize it was case sensitive??!?
    | > |
    | > | Sub LayerFilterDelete()
    | > | Dim objDict As AcadDictionary
    | > | Dim objRec As AcadObject
    | > | If ThisDrawing.Layers.HasExtensionDictionary Then
    | > | Set objDict = ThisDrawing.Layers.GetExtensionDictionary
    | > | For Each objRec In objDict
    | > | If (objRec.Name = "ACAD_LAYERFILTERS") Or _
    | > | (objRec.Name = "AcLyDictionary") Then objDict.Remove
    | > | objRec.Name
    | > | Next
    | > | End If
    | > | End Sub
    | > |
    | > | --
    | > | I love deadlines
    | > | I like the whooshing sound they make as they fly by.
    | > |
    | > |
    | > |
    | >
    | >
    |
    |
     
    Matt W, Sep 16, 2004
    #4
  5. Matt W

    Paul S Guest

    Would this work for you?
     
    Paul S, Sep 16, 2004
    #5
  6. Matt W

    Matt W Guest

    Isn't that for pre-2005??


    --
    I love deadlines
    I like the whooshing sound they make as they fly by.

    | Would this work for you?
    |
    | | > Just an FYI:
    | >
    | > Using the following code to remove Layer Properties Filters, I've
    noticed
    | > something kinda quirky.
    | > On some of my drawings (mainly Land Desktop and Building Systems, both
    | > 2005), it didn't work.
    | > HOWEVER, if I changed AcLyDictionary to ACLYDICTIONARY (all caps) then
    it
    | > works (same thing for the LSP equivalent that R Bell has posted before).
    | >
    | > I didn't realize it was case sensitive??!?
    | >
    | > Sub LayerFilterDelete()
    | > Dim objDict As AcadDictionary
    | > Dim objRec As AcadObject
    | > If ThisDrawing.Layers.HasExtensionDictionary Then
    | > Set objDict = ThisDrawing.Layers.GetExtensionDictionary
    | > For Each objRec In objDict
    | > If (objRec.Name = "ACAD_LAYERFILTERS") Or _
    | > (objRec.Name = "AcLyDictionary") Then objDict.Remove
    | > objRec.Name
    | > Next
    | > End If
    | > End Sub
    | >
    | > --
    | > I love deadlines
    | > I like the whooshing sound they make as they fly by.
    | >
    | >
    | >
    |
    |
    |
     
    Matt W, Sep 16, 2004
    #6
  7. Matt W

    Paul S Guest

    That may be. I am still in 2004 and it works for me.
     
    Paul S, Sep 16, 2004
    #7
  8. Matt,

    Something else in ADT/LDD/ABS recreates those dictionaries. I'm trying to
    get to the bottom of it.
     
    R. Robert Bell, Sep 16, 2004
    #8
  9. Matt W

    Matt W Guest

    Okay....well as long as you're on top of it. :)

    --
    I love deadlines
    I like the whooshing sound they make as they fly by.

    | Matt,
    |
    | Something else in ADT/LDD/ABS recreates those dictionaries. I'm trying to
    | get to the bottom of it.
    |
    | --
    | R. Robert Bell
    |
    |
    |
     
    Matt W, Sep 16, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.