VinniB Posted July 6, 2010 Share Posted July 6, 2010 Is there an easy way from the command prompt: to make a new layer and move ALL to that layer. I would be using a programable keyboard to run the commands. thank you for your help Vinni Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted July 6, 2010 Share Posted July 6, 2010 In menu macro form... -layer;m;mynewlayer;;change;all;;p;la;mynewlayer;; Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 6, 2010 Share Posted July 6, 2010 Perhaps a little overkill, but I had fun (defun c:AlltoLayer ( / lay ss ) ;; © Lee Mac 2010 (while (progn (setq lay (getstring t "\nSpecify Layer Name: ")) (cond ( (eq "" lay) ) ( (tblsearch "LAYER" lay) nil ) ( (entmakex (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 lay) (cons 70 0) ) ) nil ) ( (princ "\n** Invalid Layer Name **") ) ) ) ) (if (setq ss (ssget "_X" '((0 . "~VIEWPORT")))) (ApplyFootoSS (lambda ( x ) (entupd (cdr (assoc -1 (entmod (subst (cons 8 lay) (assoc 8 (entget x)) (entget x) ) ) ) ) ) ) ss ) ) (princ) ) (defun ApplyFootoSS ( foo ss ) ;; © Lee Mac 2010 ( (lambda ( i / e ) (while (setq e (ssname ss (setq i (1+ i)))) (foo e)) ) -1 ) ) Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted July 7, 2010 Share Posted July 7, 2010 Hmmmm. I get ; error: bad argument type: lselsetp nil Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted July 7, 2010 Share Posted July 7, 2010 Hmmmm. I get ; error: bad argument type: lselsetp nil [ATTACH]21511[/ATTACH] I tested in both 2004 & 2009. It worked great. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted July 7, 2010 Share Posted July 7, 2010 Perhaps a little overkill, but I had fun What is difference between ( (eq "" lay) ) and (eq "" lay) ? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 7, 2010 Share Posted July 7, 2010 Hmmmm. I get ; error: bad argument type: lselsetp nil Sorry Rk, I can't seem to get it to fail - even with nothing in the drawing Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 7, 2010 Share Posted July 7, 2010 What is difference between ( (eq "" lay) ) and (eq "" lay) ? Its a condition for the COND statement. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted July 7, 2010 Share Posted July 7, 2010 Its a condition for the COND statement. I got it Thanks Quote Link to comment Share on other sites More sharing options...
VinniB Posted July 7, 2010 Author Share Posted July 7, 2010 Thank you all for your help. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 7, 2010 Share Posted July 7, 2010 Thank you all for your help. You're very welcome Vinni Did you get it working in the end RK? Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted July 7, 2010 Share Posted July 7, 2010 Sorry Rk, I can't seem to get it to fail - even with nothing in the drawing Try it with a VIEWPORT entity in the drawing. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 7, 2010 Share Posted July 7, 2010 Try it with a VIEWPORT entity in the drawing. Aha! Many thanks - I shall look into that Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 7, 2010 Share Posted July 7, 2010 Of course, I overlooked the fact that you cannot entmod a Viewport... - quick workaround posted in previous code post. Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted July 7, 2010 Share Posted July 7, 2010 Of course, I overlooked the fact that you cannot entmod a Viewport... - quick workaround posted in previous code post. I hate to point this out, but now it doesn't meet the original objective of the OP. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 7, 2010 Share Posted July 7, 2010 I hate to point this out, but now it doesn't meet the original objective of the OP. You could accomplish it using VL, but I can't be bothered to rewrite it :wink: Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted July 7, 2010 Share Posted July 7, 2010 Or just use a menu macro to drive the ._Change command... :-) 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.