See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: Routine to toggle On/Off Xref & Layer Manager

  1. #1
    Member
    Join Date
    2013-02
    Posts
    44
    Login to Give a bone
    0

    Default Routine to toggle On/Off Xref & Layer Manager

    Please help me find a Routine to toggle On/Off Xref & Layer Manager.

    So I can open Xref or Layer Manager and close it without clicking X (close) button.

    I already got one for Property Palette.

    Thank you in advance

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

    Default Re: Routine to toggle On/Off Xref & Layer Manager

    Xref
    at command line:
    Code:
    (if (=(getvar "erstate")1)(command "_externalreferencesclose")(command "_externalreferences"))
    DIESEL macro:
    Code:
    $M=$(if,$(=,$(getvar,erstate),1),^C^C_externalreferencesclose,^C^C_externalreferences)
    Layer
    at command line:
    Code:
    (if (=(getvar "layermanagerstate")1)(command "_layerclose")(command "_layerpalette"))
    DIESEL macro:
    Code:
    $M=$(if,$(=,$(getvar,layermanagerstate),1),^C^C_layerclose,^C^C_layerpalette)
    What could be easier for Property Palette than the default Ctrl+1?
    Last edited by Tom Beauford; 2018-05-14 at 01:29 PM.

  3. #3
    Member
    Join Date
    2013-02
    Posts
    44
    Login to Give a bone
    0

    Default Re: Routine to toggle On/Off Xref & Layer Manager

    Hi Tom

    Thank you for your help but could please help me how to used this code.

    My knowledge is limited to a regular lisp routine only.

    I tried to do this:

    TOGGLE LAYER PALETTE ON/OFF
    (DEFUN C:2 ()(command "_layerclose")(command "_layerpalette"))

    TOGGLE XREF MANAGER PALETTE ON/OFF
    (DEFUN C:3 ()(command "_externalreferencesclose")(command "_externalreferences"))

    It's opens but when I enter the same command it's doesn't close or toggle.

    Here is a sample routine I got to Toggle On/Off Property Palette:

    PROPERTY PALETTE ON/OFF
    (DEFUN C:1()
    (if
    (equal (getvar 'opmstate) 2)
    (princ "\nNo toggle for you!")
    (progn
    (if
    (equal (getvar 'opmstate) 0)
    (command "properties")
    (command "propertiesclose")
    );if
    );progn
    );if
    (princ))

    Can you help me do the same.

    Thank you in advance
    Last edited by ELIANDEFI; 2018-05-16 at 07:05 AM.

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

    Default Re: Routine to toggle On/Off Xref & Layer Manager

    Quote Originally Posted by ELIANDEFI View Post
    Hi Tom
    Thank you for your help but could please help me how to used this code.
    My knowledge is limited to a regular lisp routine only.
    Add
    Code:
    (DEFUN C:2 ()(if (=(getvar "layermanagerstate")1)(command "_layerclose")(command "_layerpalette")))
    (DEFUN C:3 ()(if (=(getvar "erstate")1)(command "_externalreferencesclose")(command "_externalreferences")))
    to your acaddoc.lsp file so it will automatically load every time you open a drawing.

  5. #5
    Member
    Join Date
    2013-02
    Posts
    44
    Login to Give a bone
    0

    Default Re: Routine to toggle On/Off Xref & Layer Manager

    Hi Tom

    It works very well!

    Thank you for spending time to help me.

    Till next time.
    Last edited by ELIANDEFI; 2018-05-17 at 03:34 PM.

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

    Default Re: Routine to toggle On/Off Xref & Layer Manager

    Glad we could help!

Similar Threads

  1. Layer Freeze/Thaw toggle routine
    By jgardner.79905 in forum AutoLISP
    Replies: 5
    Last Post: 2010-02-01, 09:39 PM
  2. Ability to Update an XREF Layer from the Layer Properties Manager
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-05-08, 12:50 PM
  3. Replies: 10
    Last Post: 2007-04-27, 06:17 PM
  4. Help with a Layer toggle routine
    By thomasf in forum AutoLISP
    Replies: 4
    Last Post: 2007-01-22, 02:06 PM
  5. Replies: 5
    Last Post: 2006-12-20, 04:11 PM

Posting Permissions

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