本帖最后由 作者 于 2008-12-20 18:34:55 编辑
请教,VB编写的,出现错误为实时错误“91”,(实时变量或with变量未设置)。代码如下: Dim AcadApp As AcadApplication Dim AcadDocs As AcadDocuments Dim AcadDoc As AcadDocument Dim MoSpace As AcadModelSpace Public ztxzhtwzl1(0 To 2) As Double '块的插入位置1,m Dim xzllblock As AcadBlockReference '声明块的变量 Sub huatu() ztxzhtwzl1(0) = 15000: ztxzhtwzl1(1) = 5000: ztxzhtwzl1(2) = 0 ' 块的插入位置1,m If ModuleMenj.lzzzzl = 5 Then‘(说明:ModuleMenj.lzzzzl 是一个其它模块中的已知变量) Set xzllblock = AcadDoc.ModelSpace.InsertBlock(ztxzhtwzl1, "D:\portal crane\wheel\5wl.dwg", 1, 1, 1, 0)’将D:\portal crane\wheel\ ElseIf ModuleMenj.lzzzzl = 6 Then Set xzllblock = AcadDoc.ModelSpace.InsertBlock(ztxzhtwzl1, "D:\portal crane\wheel\6wl.dwg", 1, 1, 1, 0) ElseIf ModuleMenj.lzzzzl = 8 Then Set xzllblock = AcadDoc.ModelSpace.InsertBlock(ztxzhtwzl1, "D:\portal crane\wheel\8wl.dwg", 1, 1, 1, 0) End If xzllblock.Explode‘(此句出现错误) xzllblock.Update ZoomAll End Sub 请问是怎么回事?怎样修改?谢谢! |