ty9413 2016-05-02 06:59 采纳率: 25%
浏览 3885
已采纳

VB.NET提示未将对象引用设置到对象的实例

我做毕业设计,用VB.NET设计界面,打开pre/e的模型,但是一直错误,求指点
图片说明
Imports pfcls
Imports System.Reflection.Assembly
Public Class 建模
Public asyncConnection As IpfcAsyncConnection
Public cac As CCpfcAsyncConnection
Dim model As IpfcModel
Public parameterOwner As IpfcParameterOwner
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cac As CCpfcAsyncConnection
cac = New CCpfcAsyncConnection
asyncConnection = cac.Start("D:\Program Files\proeWildfire 4.0\bin\proe1.bat", ".")
Dim proeid As IpfcAsyncConnection
proeid = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, Nothing)
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim descModel As IpfcModelDescriptor
    Dim options As IpfcRetrieveModelOptions
    Dim session As IpfcBaseSession
    Dim currentws As Object

    session = asyncConnection.Session
    options = (New CCpfcRetrieveModelOptions).Create
    options.AskUserAboutReps = False
    session.ChangeDirectory("D:\ZY")
    descModel = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_PART, Nothing, Nothing)
    descModel.Path = "D:\ZY\asm0001.asmt"
    model = asyncConnection.Session.RetrieveModelWithOpts(descModel, options)
    session.CreateModelWindow(model)
    currentws = session.GetCurrentWS()
    model.Display()
End Sub
  • 写回答

1条回答

  • threenewbee 2016-05-02 15:43
    关注

    asyncConnection在哪里赋值的,它是nothing啊。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料