How do I create a macro for switch between two filter names within the layer properties manager? I want to switch between filter "A" and filter "B"
For example, $M=$(if,$(and,$(>,$(getvar,opmstate),0)),^C^C_propertiesclose,^C^C_properties) but I want it for named filters in the layer manager.
On the command line you can use the command "-layer" then "_filter" to get the current layer filter and set a new layer filter.
This will give you a start.
BT,
Just curious, why would you want to do this? It's only two clicks to choose a Layer Filter.
Dave
Dave Stoll
Las Vegas, Nevada
It's not necessarily only two clicks because you need to open and close the layer property manager constantly and then find the filter, close the layer property manager, reopen it to change to a different filter, close it BUT if you had different toggle button on the ribbon for quick access where you could click on for difference filter, then you dont need to constantly be accessing the layer property manager.
This is what I am trying to achieve.
Button 1: First click would filter (for example) all Interior Walls. Second click would filter all exterior walls.
Button 2: First click would filter (for example) all water pipes. Second click would filter all gas pipes.
And so forth...
For what it is worth, it doesn't appear to me you are using Civil 3D.
Bill
For what it's worth, yes, I am using 2015 Civil 3D and I'm not sure what that has to do with my question.
BT,
OK, Autohide reduces it to one click.
Dave
Dave Stoll
Las Vegas, Nevada
Dave. The OP is closing the Layer Properties Manager after each operation instead of leaving it floating and Hidden. There was a time when leaving it open would slow down the program and that might still apply to less powerful systems. I've never had the problem myself. But I remember discussions about it.
Allen
Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
andrewpuller3811 gave you a clue. You can accomplish this with a simple lisp. Copy the code below in to Notepad and save as a lisp file. This will set a Layer Filter named A current. Copy the code again and change C:LSA to C:LSB. In each file substitute your layer name for "A" in the command. Load the files using Appload. To load them automatically either add them to the Startup Suite in the Appload dialog box or add them to your acaddoc.lsp file.
;Type LSA to set a layer filter named A. ;You can substitute any filter name for "A" (defun C:LSA () (COMMAND "-layer" "_filter" "_set" "A" "") ) !
Allen Jessup
I made a little change to the lisp. I have the Layer & -Layer commands reversed on my system. So the original woldn't have worked on most machines.
Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
You can accomplish this with a simple lisp.
Crud. I tried that many times in the past and it never worked reliably. A few times it would work and more of the time it failed.
I realize why now, the layer filter name you pass it is case sensitive.
Thanks.
rkmcswain wrote:I'm fairly certain what you are asking for is not possible without programming.
My bad.
See posts 10 and 11
You technically weren't wrong. Although primitive, the lisp does count as programming.
I didn't even think of the case of the filter name. I just naturally entered it exactly as it appeared. That may be an old habit because back when I started with lisp it was much more case sensitive that it is now. I barely touch it anymore. The program does most everything I want and what it doesn't do would require the deep level programming you were thinking of.
Allen
Allen Jessup
CAD Manager - Designer
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Well, not exactly what I was trying to do as I have made it that far. I only want a single button that can toggle between "A" and "B"