See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Convert MANY blocks to Layer0

  1. #1
    Active Member
    Join Date
    2005-10
    Location
    Boston, MA
    Posts
    74
    Login to Give a bone
    0

    Cool Convert MANY blocks to Layer0

    I have a about 40 .dwg files, each with dozens of basic 2D blocks. Each block has only basic line content that I would like to change to Layer 0. (I think these .dwg's were exported from another application)

    Does anyone know of a way to automate this?

    EDIT: I don't want to explode the blocks, just change their content to Layer 0

    Thanks,
    Jon

  2. #2
    Certifiable AUGI Addict dzatto's Avatar
    Join Date
    2006-12
    Location
    Big "D"
    Posts
    3,711
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    I found this doing a search. See if it works.

    http://forums.augi.com/showthread.ph...A+nested+block

  3. #3
    Active Member
    Join Date
    2005-10
    Location
    Boston, MA
    Posts
    74
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    hmmm... this is a great lsp routine, but it would require me to pick one block at a time. I just did a filter and found that one drawing has over 700 blocks... and each block has its own unique name. (which makes me cry on the inside)

    Any other thoughts? I would love to be able to deal with this as a batch.

    Thanks,
    Jon

  4. #4
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    The SetNestedObjectsByBlock command will do what you want, but will also change all of the subentities to ByBlock color, linetype, lineweight and plot style. It will work on a selection set of multiple blocks.

  5. #5
    Certifiable AUGI Addict dzatto's Avatar
    Join Date
    2006-12
    Location
    Big "D"
    Posts
    3,711
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    Quote Originally Posted by dkoch View Post
    The SetNestedObjectsByBlock command will do what you want, but will also change all of the subentities to ByBlock color, linetype, lineweight and plot style. It will work on a selection set of multiple blocks.
    But will that also set all the entities to layer 0? I thought it just changed all the colors to ByBlock?

  6. #6
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    Quote Originally Posted by dzatto View Post
    But will that also set all the entities to layer 0? I thought it just changed all the colors to ByBlock?
    Yes sir, it goes the whole 9 yards and sets the nested objects to Layer 0 and the color, linetype, lineweight and plot style to "ByBlock".

  7. #7
    Woo! Hoo! my 1st post
    Join Date
    2009-05
    Location
    Dubai
    Posts
    1
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    You can use Laymrg command

    Example:
    Command: laymrg
    Select object on layer to merge or [Name]:
    Selected layers: Layer1.
    Select object on layer to merge or [Name/Undo]:
    Selected layers: Layer1,Layer2.
    Select object on layer to merge or [Name/Undo]:
    Selected layers: Layer1,Layer2,Layer3.
    Select object on layer to merge or [Name/Undo]:
    Selected layers: Layer1,Layer2,Layer3,Layer5.
    Select object on layer to merge or [Name/Undo]:
    Selected layers: Layer1,Layer2,Layer3,Layer5,Layer7.
    Select object on layer to merge or [Name/Undo]:
    Selected layers: Layer1,Layer2,Layer3,Layer5,Layer7,Layer8.
    Select object on layer to merge or [Name/Undo]:

    Select object on target layer or [Name]:
    ******** WARNING ********
    You are about to merge 6 layers into layer "0". ----------- (ENTER LAYER NAME "0")

    Do you wish to continue? [Yes/No] <No>: y


    Deleting layer "Layer1".

    Deleting layer "Layer2".

    Deleting layer "Layer3".

    Deleting layer "Layer5".

    Deleting layer "Layer7".

    Deleting layer "Layer8".
    6 layers deleted.

  8. #8
    Active Member
    Join Date
    2005-10
    Location
    Boston, MA
    Posts
    74
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    I have been meaning to say thank you to everyone for their solutions. The SetNestedObjectsByBlock command is exactly what I needed, and the laymrg command has come in handy too.

    Thank you,
    Jon

  9. #9
    Super Moderator CAtDiva's Avatar
    Join Date
    2015-10
    Location
    Where pedals spin to move wheels
    Posts
    442
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    Quote Originally Posted by dkoch View Post
    The SetNestedObjectsByBlock command will do what you want, but will also change all of the subentities to ByBlock color, linetype, lineweight and plot style. It will work on a selection set of multiple blocks.
    WOW!!!!! That SetNestedObjectsByBlock command is genius!!! I'd found the FixBlock LISP Dzatto linked to and tweaked it for some things, but this is much better!

    Thanks, dkoch!

  10. #10
    I could stop if I wanted to
    Join Date
    2006-02
    Posts
    424
    Login to Give a bone
    0

    Default Re: Convert MANY blocks to Layer0

    See, now I was going to mention the "laytrans" command.
    If everything was set to bylayer, you could just translate all the layers over to the "0" layer.

    I'll have to check out the "SetNestedObjectsByBlock" command sometime. Sounds like fun.

Page 1 of 2 12 LastLast

Similar Threads

  1. Convert all blocks to anonymous
    By Arterius in forum AutoLISP
    Replies: 14
    Last Post: 2013-03-11, 01:26 PM
  2. How to convert dynamic blocks to static blocks
    By moonlight_9630 in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2008-06-12, 05:10 AM
  3. dwg to bmp fast convert - make icons of blocks
    By chris.kulhanek in forum AutoCAD General
    Replies: 5
    Last Post: 2006-07-07, 07:49 PM
  4. Replies: 6
    Last Post: 2006-06-20, 12:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •