CiCAD Posted September 27, 2011 Share Posted September 27, 2011 i use section planes quite a bit and if you're familiar with planes than everytime you insert a new section plane the settings reset. i would like to insert into my template 3 section planes each with my custom settings one being for plan one being for front one being for side. each being on a seperate layer. i would like to create a macro along with a toolbar that toggles a particular layer on and off. how do i do this? using the same shortcut to turn the item both on and off? to toggle.... From what i can gather i think i need two seperate shortcuts for each layer one for on one for off. i would preffer not to do this if anyone can think of a better way Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 28, 2011 Share Posted September 28, 2011 With layers from lisp etc you can get the status of a layer its a number depends on combination of off on frozen locked, look for some layer lisps here with "assoc 70" in them should provide the answer. Quote Link to comment Share on other sites More sharing options...
CiCAD Posted September 28, 2011 Author Share Posted September 28, 2011 sorry im not familiar with how lisp operates Quote Link to comment Share on other sites More sharing options...
Tyke Posted September 28, 2011 Share Posted September 28, 2011 If you create two buttons on your palette you can assign the following command strings to turn the layer on or off: ^C^C_-layer;_on;"";; ^C^C_-layer;_off;"";; Quote Link to comment Share on other sites More sharing options...
CiCAD Posted September 28, 2011 Author Share Posted September 28, 2011 yes i am familiar with this i was hoping to not have to double up on the toolbars and have one for on and off. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 29, 2011 Share Posted September 29, 2011 Have multiple turn ons but only need 1 turn off by pick object Freeze or off its up to you its also a start for your is it on or off lisp (DEFUN C:LF () (setvar "cmdecho" 0) (SETQ DL (CDR (ASSOC 8 (ENTGET (CAR (ENTSEL "SELECT LAYER TO FREEZE: ") ))))) (if (= dl (getvar "clayer"))(setvar "clayer" "0")) (COMMAND "layer" "f" dl "") (prompt "\n LAYER FROZEN: ") (EVAL DL) ) I would have a defun that does all the work this way your command line is something like ^c^C(setq onofflay "layer1")(onoff onofflay) with the lisp onoff autoloaded at start up. Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted September 29, 2011 Share Posted September 29, 2011 Another by Lee Mac: (defun c:lsw (/ lay1 lay2) (vl-load-com) (and (setq lay1 (tblobjname "LAYER" "name of one layer");change lay1 (vlax-ename->vla-object lay1)) (setq lay2 (tblobjname "LAYER" "name of another layer");change lay2 (vlax-ename->vla-object lay2)) (cond ((eq :vlax-true (vla-get-layeron lay1)) (vla-put-layeron lay1 :vlax-false) (vla-put-layeron lay2 :vlax-true)) (t (vla-put-layeron lay2 :vlax-false) (vla-put-layeron lay1 :vlax-true)))) (princ)) Call it - lsw and hit enter to flip between layers. Quote Link to comment Share on other sites More sharing options...
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.