Moving Entities From Bad Layer To Good Layer

Discussion in 'AutoCAD' started by stck2mlon, Sep 15, 2004.

  1. stck2mlon

    stck2mlon Guest

    I have thoroughly read all of the threads pertaining to this thought, but haven't been able to figure out my issue. So, here goes.

    I have hundreds of drawings that I am going through. I run a small VBA app on them and it thaws, unlocks and turns on all layers, purges and then convert layer names to the new standard.

    Problem:
    I convert layer TREES to L-PLNT-TREE and this works great. What I want is the contents on TREES to also go on L-PLNT-TREE, obviously this isn't as simple as renaming the layer. Any Suggestions???
     
    stck2mlon, Sep 15, 2004
    #1
  2. What are you doing that doesn't make renaming the layer the obvious
    solution?

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 15, 2004
    #2
  3. stck2mlon

    Ed Jobe Guest

    The only reason I can think of that would cause trees not to be on the tree
    layer is if they were inserted on another layer. Its going to be tough to
    handle situations where your drafters didn't follow standards. You just have
    to move the trees to the right layer manually.
     
    Ed Jobe, Sep 15, 2004
    #3
  4. stck2mlon

    Jeff Mishler Guest

    You need to get a selection set of all entities on layer TREES, step through
    it and change each one to the correct layer, make sure the current layer is
    NOT TREES, attempt to delete the TREES layer, an error will occur if TREES
    is still being used by entities in blocks, step through the entites of all
    blocks that .IsLayout is false for changing those entities on layer TREES to
    the new one, attempt to delete TREES layer again, an error this time means
    that the layer is listed as a layer to be frozen in at least one PS
    viewport.

    HTH,
     
    Jeff Mishler, Sep 15, 2004
    #4
  5. stck2mlon

    Norman Yuan Guest

    Just as you already know, if a layer called "C-PLINE-TREE" already exist,
    you cannot rename other layer ("TREES") to the same name. What you need to
    do is to grab all entities in layer "TREES" and change these entities' layer
    to "C-PLINE-TREE". For example:

    Dim ent as AcadEntity
    For Each ent In ThisDrawing.ModelSpace
    If Ucase(ent.Layer)="TREES" Then
    ent.Layer="C-PLINE-TREE"
    End If
    Next

    ThisDrawing.PurgeAll

    Of course, you can use SelectionSet with layer name as filter to grab all
    entities in "TREES" layer and change their Layer property. Also, if some
    entities originally on "TREES" layer are block references and the block
    definition contains layer "TREES", then the layer "TREES" cannot be purged,
    unless you go into the block definition and change it.


    can't rename TREES to C-PLNT-TREE, I basically am trying to consolidate 2
    layers into 1.
     
    Norman Yuan, Sep 15, 2004
    #5
  6. stck2mlon

    stck2mlon Guest

    That was perfect...!!!! THANKS
     
    stck2mlon, Sep 15, 2004
    #6
  7. Just as you already know, if a layer called "C-PLINE-TREE" already exist,
    Yes, I am aware but it wasn't stated in the problem.
    Definitely - would drastically cut down processing time rather than
    iterating all entities in model space! =)

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 15, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.