Jump to content

Turn Current Layer On


Manila Wolf

Recommended Posts

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.

Link to comment
Share on other sites

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)
)

Link to comment
Share on other sites

:) 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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...