Wootney Posted September 19 Share Posted September 19 (edited) Hello all, I'm a noob at lisp, hence the very basic code, I'm having issues with the select all part of my code. It selects all and pauses there and hitting enter cancels the select all not allowing me to do the final part of the code. Any help would be greatly appreciated. (defun c:MCU () (command "LAYON") (command "LAYTHW") (command "-PURGE" "ALL" "*" "N") (setq ss (ssget "_ALL")) (command "-setbylayer" "y" "y") (princ) ) Edited September 20 by SLW210 Added Code Tags!! Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 20 Share Posted September 20 Please use code tags for code. (<> in the editor toolbar) I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the most appropriate forum. Quote Link to comment Share on other sites More sharing options...
pkenewell Posted September 20 Share Posted September 20 (edited) @Wootney You need to plug the selection set into the "-setlayer" command with a return following it. I also localized your "ss" variable, and added the "._" on the command names to allow language localization and prevent any redefined commands from mucking things up. See update below: (defun c:MCU (/ ss) ; localize the variable "ss" (command "._LAYON") (command "._LAYTHW") (command "._-PURGE" "ALL" "*" "N") (setq ss (ssget "_ALL")) (command "._-setbylayer" ss "" "y" "y");; added "ss" into command with a "" for the return. (princ) ) EDIT alternatively, you don't even need the call to ssget: (defun c:MCU () (command "._LAYON") (command "._LAYTHW") (command "._-PURGE" "_ALL" "*" "_N") (command "._-setbylayer" "_all" "" "_y" "_y") (princ) ) Edited September 20 by pkenewell 1 Quote Link to comment Share on other sites More sharing options...
Wootney Posted September 25 Author Share Posted September 25 Thanks for your help! And sorry next time I'll post in the correct spot! 1 Quote Link to comment Share on other sites More sharing options...
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.