Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Turn a Layer Off and On with button

  1. #1
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Turn a Layer Off and On with button

    I have a couple of macros that tell a layer to plot or not to plot, that i have created a buttons for:

    ^C^C(command "layer" "p" "n" "stamps" "")

    is it possible to change them to turn on / off the layer instead ?

    or is it even possible to do ?

    thanks---Derek

  2. #2
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    You can use ON and OFF or FREEZE and THAW.

  3. #3
    Wish List Manager BrenBren's Avatar
    Join Date
    2000-11
    Location
    150700
    Posts
    3,439
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    Quote Originally Posted by derek.96018 View Post
    I have a couple of macros that tell a layer to plot or not to plot, that i have created a buttons for:

    ^C^C(command "layer" "p" "n" "stamps" "")

    is it possible to change them to turn on / off the layer instead ?

    or is it even possible to do ?

    thanks---Derek
    these tools exist in AutoCAD already - depending on your version they are either a part of the express tools, or a direct part of AutoCAD - check the Layers II toolbar.

  4. #4
    All AUGI, all the time SRBalliet's Avatar
    Join Date
    2004-06
    Location
    Near Christiansburg, VA Looking for a closer job!
    Posts
    500
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    These are the macros I have associated with two buttons to turn off and on a layer called image:

    Turn On Image
    Turns A Raster Image On When It Is On A Layer Called Image
    ^C^C-layer;thaw;image;;;sp

    Turn Off Image
    Turns A Raster Image Off When It Is On A Layer Called Image
    ^C^C-layer;freeze;image;;;sp

    sp = space

  5. #5
    100 Club
    Join Date
    2005-09
    Posts
    184
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    YES, thanks Steve.

    That was exactly what I was looking for.
    I wanted to turn a layer on or off by hitting one button.

    The freeze/thaw or on/off regular AutoCAD command does not allow to turn the specific layer back on without going into the layer manager pull down.

    The only change that I made Steve is instead of the space at the end, I put the ^C to cancel out of the command. The space actually put me back into the command, leaving AutoCAD asking for more instructions...thanks again---Derek

  6. #6
    Wish List Manager BrenBren's Avatar
    Join Date
    2000-11
    Location
    150700
    Posts
    3,439
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    Quote Originally Posted by derek.96018 View Post
    YES, thanks Steve.

    That was exactly what I was looking for.
    I wanted to turn a layer on or off by hitting one button.

    The freeze/thaw or on/off regular AutoCAD command does not allow to turn the specific layer back on without going into the layer manager pull down.

    The only change that I made Steve is instead of the space at the end, I put the ^C to cancel out of the command. The space actually put me back into the command, leaving AutoCAD asking for more instructions...thanks again---Derek

    Using the command LAYOFF and LAYFRZ allow you to turn off or freeze a layer by clicking on it; LAYISO allows you to turn off all layers except selected ones; LAYON and LAYTHW will turn those layers back on or unfreeze them.

    I know that isn't what you were looking for, just pointing it out

  7. #7
    I could stop if I wanted to
    Join Date
    2006-06
    Location
    Olympia, Washington, U.S.A.
    Posts
    359
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    I set my layer command aliases as LO = layfrz LL=laythw. IL = Isolate layer.

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    There is a layer-toggle-freeze.lsp in the JTB World websites lisp section.
    Put it in your support path and use a macro like this:
    ^P(or layer-toggle-freeze (load "layer-toggle-freeze.lsp"));(layer-toggle-freeze '("Layer1" "Layer2"))
    Using you own layer names of course.

  9. #9
    Woo! Hoo! my 1st post
    Join Date
    2016-05
    Posts
    1
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    Quote Originally Posted by SRBalliet View Post
    These are the macros I have associated with two buttons to turn off and on a layer called image:

    Turn On Image
    Turns A Raster Image On When It Is On A Layer Called Image
    ^C^C-layer;thaw;image;;;sp

    Turn Off Image
    Turns A Raster Image Off When It Is On A Layer Called Image
    ^C^C-layer;freeze;image;;;sp

    sp = space
    --------------------------------

    once i load the lisp, which button do i press to turn the "image" layer on and off?

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Turn a Layer Off and On with button

    Quote Originally Posted by n_alexiou728635 View Post
    --------------------------------

    once i load the lisp, which button do i press to turn the "image" layer on and off?
    Those are 2 macros not lisp, one turns the Image layer on and the other turns it off.

    The layer-toggle-freeze.lsp link I posted above provides a toggle and I gave an example macro for toggling Layer1 & Layer2 frozen/thawed.

Page 1 of 2 12 LastLast

Similar Threads

  1. 2012: I turn a layer off and it's still visible!
    By Senninha70 in forum AutoCAD General
    Replies: 5
    Last Post: 2013-01-10, 08:13 PM
  2. Layer won't turn on.
    By vrphillips in forum AutoCAD General
    Replies: 2
    Last Post: 2011-09-28, 07:25 PM
  3. Replies: 0
    Last Post: 2011-03-15, 05:44 PM
  4. Button to Turn Reference Planes On/Off
    By Scott Hopkins in forum Revit Architecture - Wish List
    Replies: 6
    Last Post: 2005-02-11, 09:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •