Sub LayersToViews() Dim MyDrawingDoc As Document Dim MySheet As DrawingSheet Dim MyView As DrawingView Dim nI As Integer Dim nResult As Integer Dim nElemCount As Integer Dim MySelection1 As Selection Dim MySelection2 As Selection Set MyDrawingDoc = CATIA.ActiveDocument 'alles darstellen MyDrawingDoc.CurrentFilter = "All visible" Set MySheet = MyDrawingDoc.Sheets.ActiveSheet Set MySelection1 = MyDrawingDoc.Selection For nI = 1 To 100 MySelection1.Clear MySelection1.Search "Layer=" & CStr(nI) & ",all" nElemCount = MySelection1.Count2 If nElemCount > 0 Then Set MyView = MySheet.Views.Add("Layer " & CStr(nI - 2)) MySelection1.Cut MySelection1.Clear MyView.Activate Set MySelection2 = MyDrawingDoc.Selection MySelection2.Clear MySelection2.Add MyView MySelection2.Paste End If Next nI End Sub