c_space Posted February 23, 2012 Posted February 23, 2012 I am trying to make a script that starts by selecting a specific layer. The problem I am facing is that when I enter "-layer" "M" "layername", it then takes me back to all of the options whithin the layer setting. When doing it manually, I just hit escape and it takes me out of the command, however Escape doesn't translate too well in my notepad (where I writing my script). Advice? Sorry for the elementary question, I'm brand new to script writing. Quote
c_space Posted February 23, 2012 Author Posted February 23, 2012 wow.... how rookie am I? Just hit enter again and the command ceases. Quote
alanjt Posted February 23, 2012 Posted February 23, 2012 FYI: avoid the use of Escape within commands whenever possible. Quote
c_space Posted February 23, 2012 Author Posted February 23, 2012 ok.... new problem. I'm trying to use the script to select all objects on a specific layer. I'm using the layiso command, but it's asking for user input to "select objects on the layer to isolate". this terminates my script. Any adivce on that? Quote
alanjt Posted February 23, 2012 Posted February 23, 2012 Feed it a selection set. (setq ss (ssget "_X" '((8 . "LAYERNAME")))) Quote
alanjt Posted February 23, 2012 Posted February 23, 2012 Of course, if you're just wanting to turn off or isolate a certain layer, just use the -Layer command on/off. Quote
c_space Posted February 23, 2012 Author Posted February 23, 2012 yeah. me=rookie I'm not sure what to do with that? Quote
c_space Posted February 23, 2012 Author Posted February 23, 2012 Of course, if you're just wanting to turn off or isolate a certain layer, just use the -Layer command on/off. I do indeed want to just Isolate 1 layer, so that I can select all of the objects on that layer and delete them. However I haven't figured out how to do that completly through the command line. Quote
alanjt Posted February 23, 2012 Posted February 23, 2012 If you are wanting to delete the layer and it's contents, I suggest just using LAYDEL, if you want to keep the layer, you'll have to select all objects on that layer and delete. Here's bit of sample code to erase everything on a specified layer - no need for isolating. (if (setq ss (ssget "_X" '((8 . "LAYER")))) (command "_.erase" ss "")) Quote
BIGAL Posted February 24, 2012 Posted February 24, 2012 -layer examples -la off sew* enter enter -la off * enter enter -la s sewer off * on sew* enter enter 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.