Author Topic: visibility change with the layer Properties Filter  (Read 2558 times)

0 Members and 1 Guest are viewing this topic.

Harrie

  • Guest
visibility change with the layer Properties Filter
« on: September 30, 2013, 09:05:32 AM »
Is it possible to change the visibility of a layer properties filter with lisp?

Regards H.
« Last Edit: October 02, 2013, 09:45:57 AM by Harrie »

ronjonp

  • Needs a day job
  • Posts: 7527
Re: visibility change with the layer Properties Filter
« Reply #1 on: September 30, 2013, 09:35:12 AM »
Look into the +LAYER command. You can set a named filter through that.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Harrie

  • Guest
Re: visibility change with the layer Properties Filter
« Reply #2 on: September 30, 2013, 10:20:42 AM »
Thanks Ron,

But I don't want to Set a filter!
I want to put the layers in that filter On/Off, Thaw/Freeze and Lock/Unlock!

Regards H.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: visibility change with the layer Properties Filter
« Reply #3 on: September 30, 2013, 10:45:32 AM »
Sorry .. can't help.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: visibility change with the layer Properties Filter
« Reply #4 on: September 30, 2013, 05:27:51 PM »
An example of creating layer filters from scratch:
http://www.theswamp.org/index.php?topic=31362.msg505658#msg505658

Harrie

  • Guest
Re: visibility change with the layer Properties Filter
« Reply #5 on: October 01, 2013, 02:50:41 AM »
Thanks Roy,

I know the way to create layer filters and how to delete them!
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Lisp-to-Create-Layer-Filters-Add-Two-Features/td-p/3067750
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Running-a-Delete-all-Layer-Filters-lisp-routine/td-p/1090634
But I want to change the visibility of the layers in that filter On/Off, Thaw/Freeze and Lock/Unlock!

Regards H.



« Last Edit: October 01, 2013, 04:07:01 AM by Harrie »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: visibility change with the layer Properties Filter
« Reply #6 on: October 01, 2013, 04:33:23 AM »
Do you want to change an existing layer filter?
Or
Do you want to use a layer filter as a selection criterion for layers?

Harrie

  • Guest
Re: visibility change with the layer Properties Filter
« Reply #7 on: October 01, 2013, 05:58:43 AM »
Roy.

I want a selection criterion for layers!

Regards H.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: visibility change with the layer Properties Filter
« Reply #8 on: October 02, 2013, 04:36:48 AM »
@ Harrie:
Can you explain in more detail what you are trying to do:

Are you trying to do this?:
1. Create a layer filter programmatically.
2. Read the layer filter programmatically.
3. Use the layer filter as a selection criterion for the layers.
4. Do something with a list of layers (as strings, enames or objects).

If so, why not skip step 1 and step 2?

And what do you want to use the list of layers for? Let's say you have a 'Frozen' layer filter. What would you want to do with the layers that pass that filter?

Note:
There are two systems of storing layer filters. In the code samples linked to in this post the 'old' (< AC2005) "ACAD_LAYERFILTERS" system is used. The 'new' sytem uses a different dictionary: "ACLYDICTIONARY" and a different format for the filters. This means that code for reading and erasing layer filters would have to cope with both systems. The previously linked to 'erase' code does not work for the new system.
In BricsCAD (I don't use AutoCAD) editing a single 'old' style layer filter means that all filters are automatically translated to the 'new' system.

Harrie

  • Guest
Re: visibility change with the layer Properties Filter
« Reply #9 on: October 02, 2013, 10:05:05 AM »
Roy,

Instead of using 'Isolate Group', I want to use the visibility to isolate layers.
See the picture in previous comments!
The reason for this: 'Isolate Group' is dramatically slow.

Reagards, H.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: visibility change with the layer Properties Filter
« Reply #10 on: October 02, 2013, 11:44:05 AM »
Is your problem related to this:
http://www.cadsite.be/smf/index.php?topic=5785.0
Are you 'Manu'?

I want to use the visibility to isolate layers.
?
« Last Edit: October 02, 2013, 11:50:11 AM by roy_043 »

Harrie

  • Guest
Re: visibility change with the layer Properties Filter
« Reply #11 on: October 03, 2013, 04:55:59 AM »
Roy,

It is more or less related, but I'm not Manu!

Regards H.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: visibility change with the layer Properties Filter
« Reply #12 on: October 03, 2013, 06:33:12 AM »
Although you have not exactly provided a detailed description I think you want this:

Using the layer name value from your layer filters (which apparently only filter for the layer name) as a selection criterion, you want to select layers with the intention of switching them ON or OFF.

Since you know what is in your layer filters I suggest you skip steps 1 and 2 (see one of my previous posts) and try something like this:
Code: [Select]
(defun c:Off_Xref_Only () (LayerCommandHelper "*|*"  "_off"))
(defun c:On_Xref_Only ()  (LayerCommandHelper "*|*"  "_on"))
(defun c:Off_Xref_Not ()  (LayerCommandHelper "~*|*" "_off"))
(defun c:On_Xref_Not ()   (LayerCommandHelper "~*|*" "_on"))

(defun LayerCommandHelper (layerNameFilter visibiltyAction)
  (setvar 'cmdecho 0)
  (command "_.-layer" visibiltyAction layerNameFilter)
  (while (/= (getvar 'cdmactive) 0)
    (command "")
  )
  (setvar 'cmdecho 1)
  (princ)
)