Jump to content

Create a node with all the layers and turn it into a block?


Recommended Posts

Posted

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!

Posted
([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])
)

Posted

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.

Posted

Thank you Lee Mac!

 

Worked great! thank you!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...