Bill_Myron Posted November 29, 2011 Posted November 29, 2011 I am looking for something to do the following: -Create a simple node for each layer that is turned on. (@ 0,0 is fine) -Create a block of all the nodes created. This will stop people from purging all the layers. Is this possible at all? Thanks! Quote
Lee Mac Posted November 29, 2011 Posted November 29, 2011 ([color=BLUE]defun[/color] c:nodeblock ( [color=BLUE]/[/color] def name ) ([color=BLUE]setq[/color] name [color=MAROON]"nodeblock"[/color]) [color=GREEN];; Name of 'Node Block'[/color] ([color=BLUE]if[/color] ([color=BLUE]null[/color] ([color=BLUE]tblsearch[/color] [color=MAROON]"BLOCK"[/color] name)) ([color=BLUE]progn[/color] ([color=BLUE]entmake[/color] ([color=BLUE]list[/color] '(0 . [color=MAROON]"BLOCK"[/color]) '(8 . [color=MAROON]"0"[/color]) '(10 0.0 0.0 0.0) ([color=BLUE]cons[/color] 2 name) '(70 . 0) ) ) ([color=BLUE]while[/color] ([color=BLUE]setq[/color] def ([color=BLUE]tblnext[/color] [color=MAROON]"LAYER"[/color] ([color=BLUE]null[/color] def))) ([color=BLUE]if[/color] ([color=BLUE]not[/color] ([color=BLUE]minusp[/color] ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 62 def)))) ([color=BLUE]entmake[/color] ([color=BLUE]list[/color] '(0 . [color=MAROON]"POINT"[/color]) '(10 0.0 0.0 0.0) ([color=BLUE]cons[/color] 8 ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 2 def))) ) ) ) ) ([color=BLUE]entmake[/color] '((0 . [color=MAROON]"ENDBLK"[/color]) (8 . [color=MAROON]"0"[/color]))) [color=GREEN];; Comment this line to not insert block[/color] ([color=BLUE]entmake[/color] ([color=BLUE]list[/color] '(0 . [color=MAROON]"INSERT"[/color]) '(8 . [color=MAROON]"0"[/color]) '(10 0.0 0.0 0.0) ([color=BLUE]cons[/color] 2 name))) ) ([color=BLUE]princ[/color] ([color=BLUE]strcat[/color] [color=MAROON]"\n"[/color] name [color=MAROON]" already exists."[/color])) ) ([color=BLUE]princ[/color]) ) Quote
BIGAL Posted November 30, 2011 Posted November 30, 2011 Not sure if this is of help but we went the other way and purge only certain layers as a half way step our dwt has all survey library layers and blocks around 500 layers once a field survey is brought in we do a part purge -purge la fe* N -purge la dr* N and so on this way we keep all the design layers intact. We do this as script so easy to change. Lees done a great job as usual but you will keep all the junk as well. Quote
Bill_Myron Posted December 1, 2011 Author Posted December 1, 2011 Thank you Lee Mac! Worked great! thank you! 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.