C4DM4N Posted May 27, 2016 Posted May 27, 2016 (edited) Hello all you CAD Guru's out there! I am currently having trouble creating a lisp and am in desperate need of experienced guidance. I am trying to make a command such as (defun C:lo () (command "layer" "on" "*" "t" "*" "")) which turns all layers on, however i need the layers Circuit-1 through Circuit-12 to be untouched. For example if i have circuits 5 through 12 turned off, frozen, whatever state they may be in needs to not be affected by the command to turn all layers on. Basically I would like to make a command that turns all layers on with the exception of layers Circuit-1 through Circuit-12 I started to write a code based on layer groups which I though may be the way to accomplish this task. I.E. make a layer group of all layers EXCLUDING or removing Circuit 1-12 and thaw or turn on all of that layer group. I am unsuccessful in thawing the "new layer filter" using code. (I can however right click on the group and change its visibility to thawed and that works.) (defun c:TESTER (/) (COMMAND "-LAYER" "FILTER" "NEW" "GROUP" "" "*" "NEW LAYER FILTER" "") (COMMAND "-LAYER" "FILTER" "EDIT" "NEW LAYER FILTER" "DELETE" "CIRCUIT-1" "DELETE" "CIRCUIT-2" "DELETE" "CIRCUIT-3" "DELETE" "CIRCUIT-4" "DELETE" "CIRCUIT-5" "DELETE" "CIRCUIT-6" "DELETE" "CIRCUIT-7" "DELETE" "CIRCUIT-8" "DELETE" "CIRCUIT-9" "DELETE" "CIRCUIT-10" "DELETE" "CIRCUIT-11" "DELETE" "CIRCUIT-12" "") (command "-layer" "t" "new layer filter" "")) Where have I gone wrong? Edited June 1, 2016 by SLW210 Add Code Tags! Quote
iconeo Posted May 27, 2016 Posted May 27, 2016 (command "layer" "on" "!*circuit") Does this work. Don't know if you can use it ! Like this. Sent from my SM-G920T using Tapatalk Quote
C4DM4N Posted May 27, 2016 Author Posted May 27, 2016 no not quite but thank you iconeo for quickly responding! It tells me that no matching layer names are found. Quote
C4DM4N Posted May 27, 2016 Author Posted May 27, 2016 I took out the ! in the code (command "layer" "thaw" "*circuit*" "") and it seems to be working now however it is doing the opposite of what I need it to do. It is only turning on the circuit layers instead of leaving them untouched and turning on all other layers. Quote
iconeo Posted May 27, 2016 Posted May 27, 2016 So sorry, the operator is ~ not !... (command "layer" "thaw" "~*circuit*" "") I think all of these operators apply. AutoCAD 2017 Help: To Work with the Layer List in the Layer Properties Manager # (pound) Matches any numeric digit @ (at) Matches any alphabetic character . (period) Matches any non-alphanumeric character * (asterisk) Matches any string and can be used anywhere in the search string ? (question mark) Matches any single character; for example, ?BC matches ABC, 3BC, and so on ~ (tilde) Matches anything but the pattern; for example, ~*AB*matches all strings that don't contain AB [ ] Matches any one of the characters enclosed; for example, [AB]C matches AC and BC [~] Matches any character not enclosed; for example, [~AB]C matches XC but not AC [-] Specifies a range for a single character; for example, [A-G]C matches AC, BC to GC, but not HC ` (reverse quote) Reads the next character literally; for example, `~AB matches ~AB Quote
C4DM4N Posted May 27, 2016 Author Posted May 27, 2016 Yes!!! Thank you soooo much!!! That is exactly what I was looking for! You just saved the day! Quote
iconeo Posted May 27, 2016 Posted May 27, 2016 Glad to be able to help and welcome to the forum. Sent from my SM-G920T using Tapatalk Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.