MikeP Posted July 27, 2011 Share Posted July 27, 2011 Im sure this already exist. Does anyone have a lisp to quickly create layers. All I need it to do its create the layer and ask what color I want it on. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2011 Share Posted July 27, 2011 Quick + dirty: (defun c:test ( / name color ) (while (or (not (snvalid (setq name (getstring t "\nSpecify Layer Name: ")))) (tblsearch "LAYER" name) ) (princ "\nLayer Name Invalid or Already Exists.") ) (if (setq color (acad_colordlg 7 nil)) (entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 name) (cons 70 0) (cons 62 color) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
eldon Posted July 27, 2011 Share Posted July 27, 2011 (edited) Im sure this already exist. Does anyone have a lisp to quickly create layers. All I need it to do its create the layer and ask what color I want it on. Why should a lisp exist to do such a simple task? There probably is one out there and you no doubt have searched for it. If you type la at the keyboard, you will get the Layer Properties Manager dialogue box. If you want to do it all at the command line, then you can type -la, then choose Option M for make a new layer (which will be the current layer), and Option C to choose the colour, as well as a lot more options. Why look for a lisp Edited July 27, 2011 by eldon beaten by the flying fingers of a Lisp-phile Quote Link to comment Share on other sites More sharing options...
MikeP Posted July 27, 2011 Author Share Posted July 27, 2011 why does this keep happening? I cant load a lisp. I use APPLOAD to load the new lisp i renamed to "Make Layer". but after I load it it says "Make Layer.lsp successfully loaded. Command: Program ERROR Resetting environment ; error: An error has occurred inside the *error* functionbad argument type: consp nil" and when I type in the key command. it tells me Unknown command "NL". Press F1 for help." Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2011 Share Posted July 27, 2011 Sounds like you have a LISP loaded that has redefined the *error* function incorrectly. Quote Link to comment Share on other sites More sharing options...
MikeP Posted July 27, 2011 Author Share Posted July 27, 2011 so how do i troubleshoot? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2011 Share Posted July 27, 2011 so how do i troubleshoot? Open VLIDE, Go to Debug > Break on Error (checked) Perform the actions that lead to your error. After error occurs: Debug > Last Break Source Then reset your environment by going to: Debug > Reset to Top Level Debug > Break on Error (uncheck) Quote Link to comment Share on other sites More sharing options...
alanjt Posted July 27, 2011 Share Posted July 27, 2011 This has been in my startup file for years... (defun c:LM () (command "-layer" "make" ) (princ)) Quote Link to comment Share on other sites More sharing options...
MikeP Posted July 27, 2011 Author Share Posted July 27, 2011 Open VLIDE, Go to Debug > Break on Error (checked) Perform the actions that lead to your error. After error occurs: Debug > Last Break Source Then reset your environment by going to: Debug > Reset to Top Level Debug > Break on Error (uncheck) Um yeah, I have no idea how this debug things works. how do I "perform the actions" my action is loading a lisp in appload Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 27, 2011 Share Posted July 27, 2011 how do I "perform the actions" my action is loading a lisp in appload Then do that. Quote Link to comment Share on other sites More sharing options...
MikeP Posted July 27, 2011 Author Share Posted July 27, 2011 right.... and I have but it does nothing. I open the vlide. I check the break on error. then go back to the cad window. load the lisp. but it does nothing in the vlide menu. what am I missing? Quote Link to comment Share on other sites More sharing options...
MikeP Posted July 27, 2011 Author Share Posted July 27, 2011 never mind I figured it out. I was missing a parentheses in the lisp then I copied it. 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.