Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
I am new to VB api's and i have the offline documentation (HTML) but whenever i try to open index.html it gives error. So learning from the examples. So can any one show me how to create new part and add feature to it.
I have written following code but it never opens the Creo parametric application.
Dim componentFeat As pfcls.IpfcComponentFeat
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim asyncConnection As IpfcAsyncConnection = Nothing
Dim casyncConnection As CCpfcAsyncConnection
Dim session As IpfcBaseSession
Try
casyncConnection = New CCpfcAsyncConnection
asyncConnection = casyncConnection.Start("C:\Program Files\PTC\Creo 2.0\Parametric\bin\parametric.exe" + " -g:no_graphics -i:rpc_input", ".")
session = asyncConnection.Session
asyncConnection.Session.ChangeDirectory("D:\Omkar")
Dim descModel As IpfcModelDescriptor
Dim model As IpfcModel
descModel = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_PART, "D:\Omkar\propellar.prt.1", Nothing)
model = session.RetrieveModel(descModel)
Catch ex As Exception
MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)
Finally
If Not asyncConnection Is Nothing AndAlso asyncConnection.IsRunning Then
asyncConnection.End()
End If
End Try
End Sub