<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Delete Layer (second edition) in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353233#M74010</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I want to merge 2 Layers and delete the old layer from the drawing. I know,&lt;BR /&gt;
that I only can delete a layer if there is no entity in the drawing that&lt;BR /&gt;
references that layer and if it is not the current layer. So I wrote a&lt;BR /&gt;
VB-Program that does the following (it works with some layers, but not with&lt;BR /&gt;
others):&lt;BR /&gt;
&lt;BR /&gt;
FIRST:&lt;BR /&gt;
    dxfCode1(0) = 8&lt;BR /&gt;
    dxfValue1(0) = OldLayerName&lt;BR /&gt;
    SS1.Select acSelectionSetAll, , , dxfCode1, dxfValue1&lt;BR /&gt;
    For Each Obj In SS1&lt;BR /&gt;
        Obj.Layer = NewLayerName&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
SECOND:&lt;BR /&gt;
    For Each Blk In ThisDrawing.Blocks&lt;BR /&gt;
        If Blk.IsXRef Then&lt;BR /&gt;
            ' Do nothing&lt;BR /&gt;
        ElseIf UCase(Blk.Name) = "*MODEL_SPACE" Then&lt;BR /&gt;
            ' Do nothing - I think i have done this in the first step.&lt;BR /&gt;
        ElseIf UCase(Left(Blk.Name, 12)) = "*PAPER_SPACE" Then&lt;BR /&gt;
            ' Do nothing - I think i have done this in the first step.&lt;BR /&gt;
        Else&lt;BR /&gt;
            For Each Obj In Blk&lt;BR /&gt;
                If Obj.Layer = OldLayerName Then&lt;BR /&gt;
                    Obj.Layer = NewLayer&lt;BR /&gt;
                End If&lt;BR /&gt;
            Next&lt;BR /&gt;
        End If&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
Where are this layers referenced? I try this in ACAD 2002</description>
    <pubDate>Wed, 22 May 2002 05:22:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-05-22T05:22:21Z</dc:date>
    <item>
      <title>Delete Layer (second edition)</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353233#M74010</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I want to merge 2 Layers and delete the old layer from the drawing. I know,&lt;BR /&gt;
that I only can delete a layer if there is no entity in the drawing that&lt;BR /&gt;
references that layer and if it is not the current layer. So I wrote a&lt;BR /&gt;
VB-Program that does the following (it works with some layers, but not with&lt;BR /&gt;
others):&lt;BR /&gt;
&lt;BR /&gt;
FIRST:&lt;BR /&gt;
    dxfCode1(0) = 8&lt;BR /&gt;
    dxfValue1(0) = OldLayerName&lt;BR /&gt;
    SS1.Select acSelectionSetAll, , , dxfCode1, dxfValue1&lt;BR /&gt;
    For Each Obj In SS1&lt;BR /&gt;
        Obj.Layer = NewLayerName&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
SECOND:&lt;BR /&gt;
    For Each Blk In ThisDrawing.Blocks&lt;BR /&gt;
        If Blk.IsXRef Then&lt;BR /&gt;
            ' Do nothing&lt;BR /&gt;
        ElseIf UCase(Blk.Name) = "*MODEL_SPACE" Then&lt;BR /&gt;
            ' Do nothing - I think i have done this in the first step.&lt;BR /&gt;
        ElseIf UCase(Left(Blk.Name, 12)) = "*PAPER_SPACE" Then&lt;BR /&gt;
            ' Do nothing - I think i have done this in the first step.&lt;BR /&gt;
        Else&lt;BR /&gt;
            For Each Obj In Blk&lt;BR /&gt;
                If Obj.Layer = OldLayerName Then&lt;BR /&gt;
                    Obj.Layer = NewLayer&lt;BR /&gt;
                End If&lt;BR /&gt;
            Next&lt;BR /&gt;
        End If&lt;BR /&gt;
    Next&lt;BR /&gt;
&lt;BR /&gt;
Where are this layers referenced? I try this in ACAD 2002</description>
      <pubDate>Wed, 22 May 2002 05:22:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353233#M74010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-05-22T05:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Layer (second edition)</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353234#M74011</link>
      <description>Layers might be referenced by block definitions, frozen by floating&lt;BR /&gt;
viewports, or SeqEnd bug.&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
www.AcadX.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Stefan" &lt;STEFAN.1977&gt; wrote in message&lt;BR /&gt;
news:5DC64937CB125A69855AB89DC619549B@in.WebX.maYIadrTaRb...&lt;BR /&gt;
| Hi,&lt;BR /&gt;
|&lt;BR /&gt;
| I want to merge 2 Layers and delete the old layer from the drawing. I&lt;BR /&gt;
know,&lt;BR /&gt;
| that I only can delete a layer if there is no entity in the drawing that&lt;BR /&gt;
| references that layer and if it is not the current layer. So I wrote a&lt;BR /&gt;
| VB-Program that does the following (it works with some layers, but not&lt;BR /&gt;
with&lt;BR /&gt;
| others):&lt;BR /&gt;
|&lt;BR /&gt;
| FIRST:&lt;BR /&gt;
|     dxfCode1(0) = 8&lt;BR /&gt;
|     dxfValue1(0) = OldLayerName&lt;BR /&gt;
|     SS1.Select acSelectionSetAll, , , dxfCode1, dxfValue1&lt;BR /&gt;
|     For Each Obj In SS1&lt;BR /&gt;
|         Obj.Layer = NewLayerName&lt;BR /&gt;
|     Next&lt;BR /&gt;
|&lt;BR /&gt;
| SECOND:&lt;BR /&gt;
|     For Each Blk In ThisDrawing.Blocks&lt;BR /&gt;
|         If Blk.IsXRef Then&lt;BR /&gt;
|             ' Do nothing&lt;BR /&gt;
|         ElseIf UCase(Blk.Name) = "*MODEL_SPACE" Then&lt;BR /&gt;
|             ' Do nothing - I think i have done this in the first step.&lt;BR /&gt;
|         ElseIf UCase(Left(Blk.Name, 12)) = "*PAPER_SPACE" Then&lt;BR /&gt;
|             ' Do nothing - I think i have done this in the first step.&lt;BR /&gt;
|         Else&lt;BR /&gt;
|             For Each Obj In Blk&lt;BR /&gt;
|                 If Obj.Layer = OldLayerName Then&lt;BR /&gt;
|                     Obj.Layer = NewLayer&lt;BR /&gt;
|                 End If&lt;BR /&gt;
|             Next&lt;BR /&gt;
|         End If&lt;BR /&gt;
|     Next&lt;BR /&gt;
|&lt;BR /&gt;
| Where are this layers referenced? I try this in ACAD 2002&lt;BR /&gt;
|&lt;BR /&gt;
|&lt;BR /&gt;
|&lt;BR /&gt;
|&lt;/STEFAN.1977&gt;</description>
      <pubDate>Wed, 22 May 2002 05:36:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353234#M74011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-05-22T05:36:54Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353235#M74012</link>
      <description>The "frozen by floating viewports" was it. Thanks</description>
      <pubDate>Wed, 22 May 2002 05:50:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/delete-layer-second-edition/m-p/353235#M74012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-05-22T05:50:31Z</dc:date>
    </item>
  </channel>
</rss>

