Manila Wolf Posted February 23, 2012 Share Posted February 23, 2012 Is there a macro or command line entry that will turn the current layer on? I would like to do this without using the standard AutoCAD dialog box, so I can build it into a toolbutton macro. I should add that I do not want to specify the layer name, just turn on the current layer whatever the layer name might be. Thanks to anybody who can help. Quote Link to comment Share on other sites More sharing options...
rkent Posted February 23, 2012 Share Posted February 23, 2012 This will work, not sure how elegant a solution it is. (setq clyr (getvar "clayer"))(command "-layer" "on" clyr "") Quote Link to comment Share on other sites More sharing options...
Manila Wolf Posted February 23, 2012 Author Share Posted February 23, 2012 rkent, that works a treat. Thank you so much, I sincerely appreciate your help. Cheers. Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 I use this to toggle the on/off state of the current layer: (defun c:TG nil ;; toggle on/off state of current layer ;; Alan J. Thompson ((lambda (layer) (vlax-put layer 'LayerOn (~ (vlax-get layer 'LayerOn)))) (vlax-ename->vla-object (tblobjname "LAYER" (getvar 'CLAYER))) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Manila Wolf Posted February 23, 2012 Author Share Posted February 23, 2012 alanjt, many thanks for taking time to post this alternative. Works very well and can also help me. Cheers Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 alanjt, many thanks for taking time to post this alternative. Works very well and can also help me. Cheers Enjoy. .......... Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 23, 2012 Share Posted February 23, 2012 Works a treat! Thanks Alan! Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 Works a treat! Thanks Alan! Glad you like it. I was amazed how much I actually use it - made it F4 on my keyboard and I can call it transparently. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 23, 2012 Share Posted February 23, 2012 Glad you like it.I was amazed how much I actually use it - made it F4 on my keyboard and I can call it transparently. I was going to ask if you used a F# key for that. TG enter works for me, I might set something up later. How did you do the transparent call? Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 I was going to ask if you used a F# key for that. TG enter works for me, I might set something up later. How did you do the transparent call? Here it is directly out of my .MNL file... ["F4"]'TG Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 23, 2012 Share Posted February 23, 2012 That's what i thought, just add the ' . Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 That's what i thought, just add the ' . Easy as pie. Quote Link to comment Share on other sites More sharing options...
ScribbleJ Posted February 23, 2012 Share Posted February 23, 2012 Just out of curiosity. Why would the current layer be off or why would you want it to be turn off? I have always had the current layer (the one I'm working on) turned on and do not see a need to turn it off. Hopefully I will learn something quite new here. Quote Link to comment Share on other sites More sharing options...
Squirltech Posted February 23, 2012 Share Posted February 23, 2012 Just out of curiosity. Why would the current layer be off or why would you want it to be turn off? I have always had the current layer (the one I'm working on) turned on and do not see a need to turn it off. Hopefully I will learn something quite new here. +1, Good question Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 In normal design, sometimes I just want to get a quick look at the site w/o whatever it may be that I'm working on. Another way I really use it is when I'm cleaning up a surface (flipping faces, smoothing, etc.) I like to have my triangles as my current layer. From there, I can quickly turn the triangles off; pan around, find a problem area; flip layer on and fix; flip layer off and pan around until I find the next issue; rinse & repeat. Quote Link to comment Share on other sites More sharing options...
ScribbleJ Posted February 23, 2012 Share Posted February 23, 2012 I had a feeling it was something like this but couldn't think of a practical application. Thanks for sharing alan. Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 23, 2012 Share Posted February 23, 2012 I had a feeling it was something like this but couldn't think of a practical application. Thanks for sharing alan. Any time. 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.