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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to create new part and apply features like Extrude

ogavand
1-Newbie

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
Top Tags