[求助]设置活动图层的问题
<p>在VB.NET2005中,执行以下代码设置当前图层时,如果引用了autocad则没问题,如果没引用的话,最后一句会出错,谁能帮我处理一下?</p><p> </p><p>dim myc as object</p><p>dim mydwg as object</p><p>dim aclay as object</p><p> Myc = GetObject(, "AutoCAD.Application")<br/> If Err.Number <> 0 Then<br/> Myc = CreateObject("AutoCAD.application", )<br/> Err.Clear()<br/> End If<br/> Myc.Visible = True<br/> Mydwg = Myc.ActiveDocument<br/> <br/> <br/> For Each aclay In mydwg.layers<br/> If aclay.name = "table" Then<br/> Exit For<br/> End If<br/> Next<br/> <br/> mydwg.activelayer=aclay<br/></p> 运行这个会提示:找不到成员。 (异常来自 HRESULT:0x80020003 (DISP_E_MEMBERNOTFOUND))<br/><br/>谁能解决??????????<br/>
页:
[1]