Author Topic: Layer Filters "Current"  (Read 5474 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Layer Filters "Current"
« on: November 02, 2005, 02:31:59 PM »
We have 4-5 frequently used company layer filters (AutoCAD 2006, LDD 2006, 3-4 users on Civil 3d 2006). A co-worker made a  request for a Key-in/macro that will set a Filter "current" and apply this to the layer manager pull-down without opening the Layer Manager. We typically have a basemap xref that has numerous layers that must be scanned (slowly) as the Layer Manager opens. How does one go about accessing the layer filters that are defined in the drawing through LISP? I think with a push in the right direction I can do the rest of it (I hope) myself. Hints? Ideas?

Thanks in advance,
Dan

Bob Wahr

  • Guest
Re: Layer Filters "Current"
« Reply #1 on: November 02, 2005, 02:45:09 PM »

DanB

  • Bull Frog
  • Posts: 367
Re: Layer Filters "Current"
« Reply #2 on: November 02, 2005, 03:27:49 PM »
If you are referring to:

Code: [Select]
(defun C:LayerFiltersDelete ()
 (vl-Load-Com)
 (vl-Catch-All-Apply
   '(lambda ()
      (vla-Remove (vla-GetExtensionDictionary
                    (vla-Get-Layers
                      (vla-Get-ActiveDocument
                        (vlax-Get-Acad-Object))))
        "ACAD_LAYERFILTERS")))
 (princ "\nAll layer filters have been deleted.")
 (princ)
)

I don't believe AutoCAD 2006 stores the filter information as it did in older versions. The above routine no longer deletes filters in my drawing.

Bob Wahr

  • Guest
Re: Layer Filters "Current"
« Reply #3 on: November 02, 2005, 03:36:09 PM »
*shrug*  I know jack about lisp but you might try
Code: [Select]
(defun C:LayerFiltersDelete ()
(vl-Load-Com)
(vl-Catch-All-Apply
   '(lambda ()
      (vla-Remove (vla-GetExtensionDictionary
                    (vla-Get-Layers
                      (vla-Get-ActiveDocument
                        (vlax-Get-Acad-Object))))
        "ACLYDICTIONARY")))
(princ "\nAll layer filters have been deleted.")
(princ)
)

Hadn't thought about it but between r15 and r16 it switched from ACAD_LAYERFILTERS to ACLYDICTIONARY


CarlB

  • Guest
Re: Layer Filters "Current"
« Reply #4 on: November 02, 2005, 05:38:14 PM »
Robert Bell's "LFD" modified to work in 2005 & 2006 , with wildcards, should give you something to work with.

http://discussion.autodesk.com/servlet/JiveServlet/download/130-335314-3861685-30875/LayerFiltersDelete.lsp

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Layer Filters "Current"
« Reply #5 on: November 02, 2005, 05:48:09 PM »
I have not yet seen anything that will let you set a layer filter current.  I have seen other post asking the question in other forumns, but none have had an answer of how to do it.  Sorry.

Tim
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

whdjr

  • Guest
Re: Layer Filters "Current"
« Reply #6 on: November 03, 2005, 10:11:46 AM »
You may have to go the command route:

Code: [Select]
(command "-lman" "restore" "putyourlayerstatehere" "")
coded blindly - hope it works

Bob Wahr

  • Guest
Re: Layer Filters "Current"
« Reply #7 on: November 03, 2005, 10:59:35 AM »
Layer state and layer filter are two different animals.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Layer Filters "Current"
« Reply #8 on: November 03, 2005, 12:09:31 PM »
To the best of my knowledge, the layer filters are not exposed to Lisp or VBA.  I have tried to get filters in code, and was denied both times.  Maybe 2006 / 2007 has it
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bob Wahr

  • Guest
Re: Layer Filters "Current"
« Reply #9 on: November 03, 2005, 12:24:46 PM »

DanB

  • Bull Frog
  • Posts: 367
Re: Layer Filters "Current"
« Reply #10 on: November 03, 2005, 12:28:33 PM »
I think this task is either beyond my LISPing capabilities or is just not feasible. Thanks all for the replies/comments. Ii do check in from time to time, so if any new discoveries are made for accessing Layer filters please share.

Bob Wahr

  • Guest
Re: Layer Filters "Current"
« Reply #11 on: November 03, 2005, 12:32:25 PM »
I didn't want to discourage you by telling you that you couldn't do it.  Heck, there was a chance that you would trip over something that everyone else had missed.  Then you would be legendary.  You would be the hero of literally tens of people.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Layer Filters "Current"
« Reply #12 on: November 03, 2005, 12:35:37 PM »
Am I missing something here? Aren't layer filters just an entry in an extension dictionary attached to the layers collection?

Quote
====================================Object====================================

<IAcadLayers2 2130144272>

==================================Properties==================================

_NewEnum                 <IUnknown>
Application              <IAcadApplication>
Count                    10
Database                 <IAcadDatabase>
Document                 <IAcadDocument>
Handle                   2
HasExtensionDictionary   :vlax-true
ObjectID                 2130144272
ObjectName               AcDbLayerTable
OwnerID                  0

===================================Methods====================================

Add
Delete
Erase
GenerateUsageData
GetExtensionDictionary
GetXdata
Item
SetXdata

===============================DXF Group Codes================================

-1    <Entity name: 7ef76c10>
0     TABLE
2     LAYER
5     2
102   {ACAD_XDICTIONARY
360   <Entity name: 7ef76ee0>
102   }
330   <Entity name: 0>
100   AcDbSymbolTable
70    10

Quote
====================================Object====================================

<IAcadDictionary 2130144992>

==================================Properties==================================

_NewEnum                 <IUnknown>
Application              <IAcadApplication>
Count                    2
Database                 <IAcadDatabase>
Document                 <IAcadDocument>
Handle                   94
HasExtensionDictionary   :vlax-false
Name                     <Null Object, Reference or Value>
ObjectID                 2130144992
ObjectName               AcDbDictionary
OwnerID                  2130144272

===================================Methods====================================

AddObject
AddXRecord
Delete
Erase
GetExtensionDictionary
GetName
GetObject
GetXdata
Item
Remove
Rename
Replace
SetXdata

===============================DXF Group Codes================================

-1    <Entity name: 7ef76ee0>
0     DICTIONARY
330   <Entity name: 7ef76c10>
5     94
100   AcDbDictionary
280   1
281   1
3     ACAD_LAYERFILTERS
360   <Entity name: 7ef76ef0>
3     ACLYDICTIONARY
360   <Entity name: 7ef76ee8>

Quote
====================================Object====================================

<IAcadDictionary 2130145008> (1/2 of <IAcadDictionary 2130144992>)

==================================Properties==================================

_NewEnum                 <IUnknown>
Application              <IAcadApplication>
Count                    0
Database                 <IAcadDatabase>
Document                 <IAcadDocument>
Handle                   96
HasExtensionDictionary   :vlax-false
Name                     ACAD_LAYERFILTERS
ObjectID                 2130145008
ObjectName               AcDbDictionary
OwnerID                  2130144992

===================================Methods====================================

AddObject
AddXRecord
Delete
Erase
GetExtensionDictionary
GetName
GetObject
GetXdata
Item
Remove
Rename
Replace
SetXdata

===============================DXF Group Codes================================

-1    <Entity name: 7ef76ef0>
0     DICTIONARY
5     96
102   {ACAD_REACTORS
330   <Entity name: 7ef76ee0>
102   }
330   <Entity name: 7ef76ee0>
100   AcDbDictionary
280   0
281   1
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Layer Filters "Current"
« Reply #13 on: November 03, 2005, 12:45:14 PM »
Michael, correct you are. However, I have not seen anyone be able to set which one the Layer dialogue uses. Therein lies the problem.......

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Layer Filters "Current"
« Reply #14 on: November 03, 2005, 12:46:00 PM »
Ahhh, thanks for lighting the candle Jeff.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst