raknahs 0 Newbie Poster

Dim asynconn As New pfcls.CCpfcAsyncConnection
Dim conn As pfcls.IpfcAsyncConnection
Dim session As pfcls.IpfcBaseSession
Dim oModel As pfcls.IpfcModel
Dim A As IpfcBaseParameter
Dim Av As IpfcParamValue
Dim A_value As Double
Dim A_value_new As Double
Dim new_paramowner As pfcls.IpfcParameterOwner
Dim pa_model As pfcls.CCpfcRegenInstructions
Dim asyncConnection As IpfcAsyncConnection
Dim cAC As CCpfcAsyncConnection

Dim descModel As IpfcModelDescriptor
Dim descModelCreate As CCpfcModelDescriptor
Dim model As IpfcModel
Dim workDir As String
Dim solidProperties As IpfcMassProperty
Dim solid As IpfcSolid
Dim ctype As CCpfcXSecCutobjType

Dim exepath As Variant

Dim position As Integer

Private Sub btngetmasp_Click()
Set oModel = session.CurrentModel
solid = solid.GetMassProperty
x = oModel.FileName
Set solidProperties = solid.GetMassProperty(Nothing)
gravityCentre = solidProperties.GravityCenter
MsgBox ("The solid mass is: " + solidProperties.Mass + Chr(13).ToString + "The solid volume is: " + solidProperties.Volume + Chr(13).ToString + "The Centre of Gravity is at: " + Chr(13).ToString + "X : " + gravityCentre.Item(0).ToString + Chr(13).ToString + "Y : " + gravityCentre.Item(1).ToString + Chr(13).ToString + "Z : " + gravityCentre.Item(2).ToString + Chr(13).ToString)
End Sub

Private Sub Form_Load()
btnrun_click
End Sub
'Private Sub btngetmasp_click()
'lblstatus.Text = ""
'run.printmassproperties (conn.session)
'lblstatus.Text = "mass properties displayed"

'End Sub
Private Sub pmp_click()

End Sub
Private Sub btnrun_click()

'Set cAC = New CCpfcAsyncConnection
'Set asyncConnection = cAC.Start("C:\Program Files\PTC\Creo 1.0\Parametric\bin\parametric.exe", workingdirectory)
'MsgBox (asyncConnection.IsRunning)

Set conn = asynconn.Connect("", "", ".", 5)
Set session = conn.session
Set oModel = session.CurrentModel
MsgBox "Model name = " & oModel.FileName

btngetmasp_Click

Set new_paramowner = oModel
Set A = new_paramowner.GetParam("EZ")
'Set Av = A.Value
'A_value = Av.DoubleValue

MsgBox "EZ = " & A_value
'Av.DoubleValue = 20
'A.Value = Av
oModel.Save

'MsgBox "EZ = " & A.Value.DoubleValue
conn.Disconnect (2)

Set asynconn = Nothing
Set conn = Nothing
Set session = Nothing
Set oModel = Nothing

End Sub

based on this how can we create model in proengineer using visual basic 6.0

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.