本帖最后由 作者 于 2008-12-10 23:09:17 编辑
请教 Dim AcadApp, AcadDoc, gridLayer As Object On Error Resume Next AcadApp = GetObject(, "AutoCAD.Application") If Err.Number <> 0 Then Err.Clear() AcadApp = CreateObject("AutoCAD.Application") If Err.Number <> 0 Then End End If AcadApp.Visible = True AcadDoc = AcadApp.ActiveDocument gridLayer = AcadDoc.Layers.Add("网格") ’在CAD里这个层已经建出来了 AcadDoc.ActiveLayer = gridLayer ‘这儿出错了 错在那儿了呢 AcadDoc.ActiveLayer.color = 5 也是对的就不是能给activelayer对象赋值 |