Originally Posted by
KingBlads
G'day
I've just had a question posed through our user group website and as I haven't touched AutoCAD in a long time, so I thought it better to ask here...
The question is...
What I'm trying to do is to create a button that when pressed on a new drawing, it brings in all your layers. I know this can be done, but I don't know how to do it?
Unfortunately I have no idea which version of AutoCAD they are running. Can anyone assist? Thanks in advance
Another way to do it is to have the button execute a lisp that creates the layers. Not only does it create the correct layers, but it will fix layers that already exist but have the incorrect color or linetype.
Button:
^C^C^P(load "L:/gcw-menus/lisp/GCWLayerSetMaster.lsp");LayerSetMaster
Lisp:
Code:
(defun c:LayerSetMaster ()
(setvar "cmdecho" 0)
(setvar "filedia" 0)
(setq oldlayer (getvar "clayer"))
(setq oldexpert (getvar "expert"))
(setvar "expert" 3)
(command "-linetype" "l" "*" "L:/Linetype/gcw.lin" "")
(command "-layer"
"m" "C-CURB-BACK" "c" "7" "" "l" "continuous" ""
"m" "C-CURB-TICK" "c" "220" "" "l" "continuous" ""
"m" "C-DRWY" "c" "21" "" "l" "continuous" ""
"m" "C-DRWY-PATT" "c" "253" "" "l" "continuous" ""
"m" "C-ESMT" "c" "41" "" "l" "G-ESMT" ""
"m" "C-ESMT-CNTL" "c" "2" "" "l" "CENTER2" ""
"m" "C-ESMT-SITE" "c" "60" "" "l" "G-ESMT" ""
"m" "C-ESMT-SITE-PATT" "c" "24" "" "l" "continuous" ""
"m" "C-LOTT" "c" "60" "" "l" "continuous" ""
"m" "C-PROP" "c" "11" "" "l" "PHANTOM2" ""
"m" "C-PROP-TICK" "c" "220" "" "l" "continuous" ""
"m" "C-ROAD-CNTL" "c" "2" "" "l" "CENTER2" ""
"m" "C-ROAD-EPMT" "c" "3" "" "l" "continuous" ""
"m" "C-ROAD-GDBK" "c" "41" "" "l" "HIDDEN2" ""
"m" "C-ROAD-RWAY" "c" "6" "" "l" "G-SMALLDASHPL" ""
"m" "C-ROAD-TICK" "c" "220" "" "l" "continuous" ""
"m" "C-SDWK" "c" "3" "" "l" "continuous" ""
"m" "C-SDWK-PATT" "c" "252" "" "l" "continuous" ""
"m" "C-SDWK-RAMP" "c" "2" "" "l" "continuous" ""
"m" "C-SETB" "c" "7" "" "l" "HIDDEN" ""
""
)
(setvar "clayer" oldlayer)
(setvar "filedia" 1)
(setvar "expert" oldexpert)
(princ)
)