Sub test() ' 连接ACAD Dim AcadApp As Object Set AcadApp = GetObject(, "AutoCAD.Application") If Err Then Err.Clear Set AcadApp = CreateObject("AutoCAD.Application") If Err Then Exit Sub End If ' 创建层 AcadApp.ActiveDocument.Layers.Add ("New_Layer") End Sub