HandletoObject在VB中如何写
<P>在AutoCad的VBA中调试成功如下语句.</P><P>set EntyObj = ThisDrawing.HandletoObject("54EA") '句柄</P>
<P>EntyObj.color = acRed '通过句柄的实体变成红色</P>
<P>上面语句移植到VB中,语句定义出错.</P>
<P>请教各位大侠,</P>
<P>set EntyObj = ThisDrawing.HandletoObject("54EA") 这句话如何改</P>
<P>谢谢</P> <P> ThisDrawing是空值么?</P>
<P> </P> <P>1,先引用acad</P>
<P>2,调用acad</P>
<P>Public Function CallCAD()<BR>On Error Resume Next<BR>Dim AcadApp As AcadApplication<BR>Set AcadApp = GetObject(, "AutoCAD.Application")<BR>If Err Then<BR>Err.Clear<BR>Set AcadApp = CreateObject("AutoCAD.Application")<BR>AcadApp.Visible = True<BR>If Err Then<BR>MsgBox Err.Description<BR>Exit Function<BR>End If<BR>End If<BR>Set acadDoc = AcadApp.ActiveDocument<BR>End Function</P>
<P>3,set EntyObj = acadDoc.HandletoObject("54EA") </P>
谢谢
页:
[1]