Author Topic: code to close 'layer properties manager' dialog  (Read 9519 times)

0 Members and 1 Guest are viewing this topic.

jaydee

  • Guest
code to close 'layer properties manager' dialog
« on: September 14, 2011, 08:12:36 PM »
Hi.
Is there a lisp code to close 'layer properties manager'.
It would script process hundreds of drawings alot quicker if the layer manager NOT open due to long list of layers.

Normally i would exit cad seesion with 'layer properties manager' close, but sometime i forget.

Thankyou

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: code to close 'layer properties manager' dialog
« Reply #1 on: September 14, 2011, 08:25:57 PM »
Why not use "-layer"  :?

jaydee

  • Guest
Re: code to close 'layer properties manager' dialog
« Reply #2 on: September 14, 2011, 08:54:54 PM »
Thanks Lee
No, Im not trying to access the layer properties.
I just want to close the 'layer properties manager' dialog if its open.
By default acad will have it open on start up if the last cad session had it open.

generally if a drawing contain a very large list of layers, it will take a few seconds longer to open a drawing.

Acad2011

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: code to close 'layer properties manager' dialog
« Reply #3 on: September 14, 2011, 10:34:20 PM »
I prefer the command line version of LAYER (must faster IMO).

Here's a sample in a toggle (assuming you are referring to newer versions that have the layer manager as a dockable palette)...

Code: [Select]
(defun c:LY (/)
  (if (zerop (getvar 'LAYERMANAGERSTATE))
    (progn (initdia) (command "_.layer"))
    (command "_.layerclose")
  )
  (princ)
)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

BlackBox

  • King Gator
  • Posts: 3770
Re: code to close 'layer properties manager' dialog
« Reply #4 on: September 14, 2011, 10:53:19 PM »
Is the LAYERMANAGERSTATE System Variable Read-Only?

If not, why not use Setvar instead of Command?
(I don't have AutoCAD available at the moment to look up in SYSVDLG)
"How we think determines what we do, and what we do determines what we get."

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: code to close 'layer properties manager' dialog
« Reply #5 on: September 14, 2011, 10:55:02 PM »
Is the LAYERMANAGERSTATE System Variable Read-Only?

If not, why not use Setvar instead of Command?
(I don't have AutoCAD available at the moment to look up in SYSVDLG)
I'm offended you thought I hadn't thought of that.  :lol:
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

BlackBox

  • King Gator
  • Posts: 3770
Re: code to close 'layer properties manager' dialog
« Reply #6 on: September 14, 2011, 11:04:45 PM »
Is the LAYERMANAGERSTATE System Variable Read-Only?

If not, why not use Setvar instead of Command?
(I don't have AutoCAD available at the moment to look up in SYSVDLG)
I'm offended you thought I hadn't thought of that.  :lol:

That was fast!

Well, that's not at all what I intended... I was actually asking for my own edification.

I was still lmao from the post I just made, that I didn't give it a whole lot of thought before I posted the question (something I'm apparently struggling with these days). In any event, thanks for clearing that up for me, and enjoy the funny post I made elsewhere!

Cheers! :beer:
"How we think determines what we do, and what we do determines what we get."

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: code to close 'layer properties manager' dialog
« Reply #7 on: September 14, 2011, 11:09:05 PM »
I know; just joshing you.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

jaydee

  • Guest
Re: code to close 'layer properties manager' dialog
« Reply #8 on: September 14, 2011, 11:31:01 PM »
Thanks guys
Not sure how i missed this one, i did look up the "L" command reference in acad site prior posting.

layerclose is what i want.

cheers

Chris

  • Swamp Rat
  • Posts: 548
Re: code to close 'layer properties manager' dialog
« Reply #9 on: September 15, 2011, 07:59:18 AM »
shortcutted at my office to be LAC.

we cant use the layer palette, it makes switching between drawings way too slow.  Been complaining to autodesk for some time about it, they still havent fixed it.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: code to close 'layer properties manager' dialog
« Reply #10 on: September 15, 2011, 08:34:15 AM »
shortcutted at my office to be LAC.

we cant use the layer palette, it makes switching between drawings way too slow.  Been complaining to autodesk for some time about it, they still havent fixed it.
I use -layer (defined as LA in my pgp file) for most everything and classiclayer for those random occasions when I need to do something I can't from -layer.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: code to close 'layer properties manager' dialog
« Reply #11 on: September 15, 2011, 02:53:31 PM »
No, Im not trying to access the layer properties.
I just want to close the 'layer properties manager' dialog if its open.
By default acad will have it open on start up if the last cad session had it open.

generally if a drawing contain a very large list of layers, it will take a few seconds longer to open a drawing.

Oh I see - I presumed you were using the standard "Layer" command within a Script of some kind and weren't aware of the "-Layer" command line version.

Glad you have a solution now :-)

trogg

  • Bull Frog
  • Posts: 255
Re: code to close 'layer properties manager' dialog
« Reply #12 on: September 15, 2011, 10:58:53 PM »
I don't know if this would work.
I'm am still learning.
This could be incorporated into some code
Code: [Select]
(if (= 1 (getvar "LAYERMANAGERSTATE"))
   (command "._LAYERCLOSE")

JohnK

  • Administrator
  • Seagull
  • Posts: 10652
Re: code to close 'layer properties manager' dialog
« Reply #13 on: September 16, 2011, 12:08:29 AM »
I don't know if this would work.
I'm am still learning.
This could be incorporated into some code
Code: [Select]
(if (= 1 (getvar "LAYERMANAGERSTATE"))
   (command "._LAYERCLOSE")

I prefer the command line version of LAYER (must faster IMO).

Here's a sample in a toggle (assuming you are referring to newer versions that have the layer manager as a dockable palette)...

Code: [Select]
(defun c:LY (/)
  (if (zerop (getvar 'LAYERMANAGERSTATE))
    (progn (initdia) (command "_.layer"))
    (command "_.layerclose")
  )
  (princ)
)

Not sure, but this could be the answer.
Code: [Select]
(cond
    ((not (zerop (getvar 'LAYERMANAGERSTATE)))
        (command "_.layerclose")))
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: code to close 'layer properties manager' dialog
« Reply #14 on: September 16, 2011, 06:53:29 AM »

Not sure, but this could be the answer.
Code: [Select]
(cond
    ((not (zerop (getvar 'LAYERMANAGERSTATE)))
        (command "_.layerclose")))


You could also use AND+VL-CMDF combo:

Code: [Select]
(and  (not (zerop (getvar 'LAYERMANAGERSTATE)))
      (vl-cmdf "_.layerclose"))
"How we think determines what we do, and what we do determines what we get."