SLW210 Posted November 25, 2014 Posted November 25, 2014 I merged your two threads on this topic, you can ask for a LISP and/or a Macro in the same thread, no need for two threads on same question, it makes things confusing. Quote
Lee Mac Posted November 25, 2014 Posted November 25, 2014 I like to re-open this thread again as I frequently found out that instead of a fixed layer name, i have encounter layers that share the same name but with a slight difference.So is it possible to incoporate a wildcard name eg. *rev* Thanks Yes, my posted code already allows you to do this. Quote
vernonlee Posted November 26, 2014 Author Posted November 26, 2014 Yes, my posted code already allows you to do this. Last night I realized that by adding * at the from & back of the text it works for the macro script. Lee, this applies for your lisp as well? btw, can it isloate in paperspace now? Thanks Quote
ttray33y Posted November 26, 2014 Posted November 26, 2014 (edited) try this, you can set upto x no. of layers. ;;predefine selection (setq lay1 "?") ;;isolate layer 0 as (default) ;;define function (defun c:test () ;;turn on the echo command (setvar "cmdecho" 1) ;;enter a layer name or press ENTER to skip (setq clay1 (getstring (strcat "\nEnter layer name list <" lay1 ">: "))) (if (= clay1 "") (setq clay1 lay1) (setq lay1 clay1) ) ;;Main (command "-layer" "OFF" "*" "Y" "") (command "-layer" "ON" lay1 "" "") (command "zoom" "0.85x") (princ) ) (defun c:ret () ;;define function (command "-layer" "ON" "*" "") ;;turn on all layers (command "zoom" "e") (princ) ) (princ "\nEnter test to isolate & ret to return.") (princ "\nttray33y @ CADTUTOR.") (princ) i know someone here can write a shorter version for this, but anyway i am just sharing. Edited November 26, 2014 by ttray33y revised to add list of layers. Quote
vernonlee Posted November 27, 2014 Author Posted November 27, 2014 try this, you can set upto x no. of layers. ;;predefine selection (setq lay1 "?") ;;isolate layer 0 as (default) ;;define function (defun c:test () ;;turn on the echo command (setvar "cmdecho" 1) ;;enter a layer name or press ENTER to skip (setq clay1 (getstring (strcat "\nEnter layer name list <" lay1 ">: "))) (if (= clay1 "") (setq clay1 lay1) (setq lay1 clay1) ) ;;Main (command "-layer" "OFF" "*" "Y" "") (command "-layer" "ON" lay1 "" "") (command "zoom" "0.85x") (princ) ) (defun c:ret () ;;define function (command "-layer" "ON" "*" "") ;;turn on all layers (command "zoom" "e") (princ) ) (princ "\nEnter test to isolate & ret to return.") (princ "\nttray33y @ CADTUTOR.") (princ) i know someone here can write a shorter version for this, but anyway i am just sharing. Thanks bro. I do need to have an option to have predefined layers within the lisp itself though. Interesting lisp nevertheless Quote
ttray33y Posted November 27, 2014 Posted November 27, 2014 Thanks bro. I do need to have an option to have predefined layers within the lisp itself though. Interesting lisp nevertheless youre welcome bro. 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.