cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to create new part and apply features like Extrude

ogavand
1-Visitor

How to create new part and apply features like Extrude

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

0 REPLIES 0
Announcements


Top Tags