当前位置:文档之家› PROE二次开发

PROE二次开发

Imports pfcls
Public Class Form1
Private a As IpfcAsyncConnection = Nothing
Private b As IpfcBaseSession
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
a = (New CCpfcAsyncConnection).Start("C:\Program Files\proeWildfire 5.0\bin\proe.exe""C:\Program Files\proeWildfire 5.0\bin\proe.exe", ".")
b = a.Session
b.ChangeDirectory("F:\proe_exampledir")
End Sub
End Class






Imports pfcls
Imports System.Data.SqlClient
Public Class Form1

Private a As IpfcAsyncConnection = Nothing
Private b As IpfcBaseSession



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
a = (New CCpfcAsyncConnection).Start("C:\Program Files\proeWildfire 5.0\bin\proe.exe", ".") 'Pro/e的启动路径
b = a.Session
b.ChangeDirectory("D:\pro培训") '改变工作目录()
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
Me.TopMost = True

End Sub
End Class




Public Sub openfile(ByRef session As IpfcBaseSession, _
ByVal componentFileName As String)
Dim cmodel As IpfcModel
Dim modelDesc As IpfcModelDescriptor
Dim componentModel As IpfcSolid

modelDesc = (New CCpfcModelDescriptor).CreateFromFileName(componentFileName)
componentModel = session.GetModelFromDescr(modelDesc)

componentModel = session.RetrieveModel(modelDesc)

cmodel = CType(componentModel, IpfcModel)
cmodel.Display()

End Sub

相关主题
文本预览
相关文档 最新文档