NoelStalker Posted October 20, 2009 Posted October 20, 2009 I am trying to create a lisp routine that will set the layer to "1", freeze all (I have a working command for freeze all called "fa") chprop of all to layer "am_0" and then thaw all (once again I have a working command for thaw all called "ta"). Can any of you tell me why this lisp routine is not working? Please see the code below... (defun c:am0 () (command "-layer" "set" "1" " " "fa" "chprop" "all" " " "la" "am_0" " " "ta") ) Quote
alanjt Posted October 20, 2009 Posted October 20, 2009 I am trying to create a lisp routine that will set the layer to "1", freeze all (I have a working command for freeze all called "fa") chprop of all to layer "am_0" and then thaw all (once again I have a working command for thaw all called "ta"). Can any of you tell me why this lisp routine is not working? Please see the code below... (defun c:am0 () (command "-layer" "set" "1" " " "fa" "chprop" "all" " " "la" "am_0" " " "ta") ) You can't call another routine like that. Either include the appropriate coding, or use (c:FA) when you need to call it. You'll have to start a new command string; can't include (c:FA) or (c:TA) in them. Quote
NoelStalker Posted October 20, 2009 Author Posted October 20, 2009 OK. Thank you alanjt. I put all of the commands in there but I am still getting an error. This time the error reads: "Command: am0 Cannot freeze layer "1". It is the CURRENT layer. Invalid option keyword. ; error: Function cancelled Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness]:" Below is my revised code: (defun c:am0 () (command "-layer" "set" "1" "freeze" "*" "" "chprop" "all" "" "la" "am_0" "thaw" "*" "") ) Quote
alanjt Posted October 20, 2009 Posted October 20, 2009 OK. Thank you alanjt. I put all of the commands in there but I am still getting an error. This time the error reads: "Command: am0 Cannot freeze layer "1". It is the CURRENT layer. Invalid option keyword. ; error: Function cancelled Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness]:" Below is my revised code: (defun c:am0 () (command "-layer" "set" "1" "freeze" "*" "" "chprop" "all" "" "la" "am_0" "thaw" "*" "") ) Add one more "" to the end and try it. It will work, if you have objects on layer "1" and layers "1" and "am_0" exist. Command: am0 -layer Current layer: "1" Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: set Enter layer name to make current or <select object>: 1 Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: freeze Enter name list of layer(s) to freeze or <select objects>: * Cannot freeze layer "1". It is the CURRENT layer. Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck /Unlock/stAte/Description/rEconcile]: Command: chprop Select objects: all 1 found Select objects: Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/Material/Annotative]: la Enter new layer name <1>: am_0 Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/Material/Annotative]: thaw Invalid option keyword. Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness/Material/Annotative]: Quote
NoelStalker Posted October 20, 2009 Author Posted October 20, 2009 Thank you alanjt, I got it to work now. Quote
alanjt Posted October 20, 2009 Posted October 20, 2009 Thank you alanjt, I got it to work now. Good deal. No problem. Quote
Recommended Posts
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.