Message 1 of 3
Delete Layer (second edition)
Not applicable
05-21-2002
10:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to merge 2 Layers and delete the old layer from the drawing. I know,
that I only can delete a layer if there is no entity in the drawing that
references that layer and if it is not the current layer. So I wrote a
VB-Program that does the following (it works with some layers, but not with
others):
FIRST:
dxfCode1(0) = 8
dxfValue1(0) = OldLayerName
SS1.Select acSelectionSetAll, , , dxfCode1, dxfValue1
For Each Obj In SS1
Obj.Layer = NewLayerName
Next
SECOND:
For Each Blk In ThisDrawing.Blocks
If Blk.IsXRef Then
' Do nothing
ElseIf UCase(Blk.Name) = "*MODEL_SPACE" Then
' Do nothing - I think i have done this in the first step.
ElseIf UCase(Left(Blk.Name, 12)) = "*PAPER_SPACE" Then
' Do nothing - I think i have done this in the first step.
Else
For Each Obj In Blk
If Obj.Layer = OldLayerName Then
Obj.Layer = NewLayer
End If
Next
End If
Next
Where are this layers referenced? I try this in ACAD 2002
I want to merge 2 Layers and delete the old layer from the drawing. I know,
that I only can delete a layer if there is no entity in the drawing that
references that layer and if it is not the current layer. So I wrote a
VB-Program that does the following (it works with some layers, but not with
others):
FIRST:
dxfCode1(0) = 8
dxfValue1(0) = OldLayerName
SS1.Select acSelectionSetAll, , , dxfCode1, dxfValue1
For Each Obj In SS1
Obj.Layer = NewLayerName
Next
SECOND:
For Each Blk In ThisDrawing.Blocks
If Blk.IsXRef Then
' Do nothing
ElseIf UCase(Blk.Name) = "*MODEL_SPACE" Then
' Do nothing - I think i have done this in the first step.
ElseIf UCase(Left(Blk.Name, 12)) = "*PAPER_SPACE" Then
' Do nothing - I think i have done this in the first step.
Else
For Each Obj In Blk
If Obj.Layer = OldLayerName Then
Obj.Layer = NewLayer
End If
Next
End If
Next
Where are this layers referenced? I try this in ACAD 2002