Documente Academic
Documente Profesional
Documente Cultură
Pratheesh Russell.S
Parameters:
This is the most simple of the three methods with lots of online tutorials.
First you must set parameters in CREO and set relations manually to connect the
parameters with relevant dimensions. The next step is to retrieve the parameters
through code you must connect to CREO initially, I wont go into that but that is
the preliminary step. Once connected initialize a few variables Dim params As
IpfcParameters, Dim param As IpfcBaseParameter, Dim paramValue As
IpfcParamValue and set
params = session.CurrentModel.ListParams()
For i = 1 To (params.Count - 1)
param = params(i)
paramValue = param.Value
If paramValue.discr = 3 Then 'if parameter is real value
Dim str(2) As String
Dim itm As ListViewItem
str(0) = param.name the name of the parameter
str(1) = paramValue.DoubleValue the value of the parameter
<Do something with the parameter here>
End If
Next i
Now to change the value of a parameter and update it.
It is usually easier if the values like model name, parameter names are saved
initially to a list and retrieved from the saved list when changing it.
Dimensions:
In the first method we indirectly edited the dimensions in this method we
will directly edit it. Although you can retrieve all dimensions and modify them it
will be easier if you set a name to that dimension so that you can identify which
dimension you have change. Now to retrieve the dimensions through code dont
forget to connect to CREO initially.
Relations:
In this method we will edit relations. First we will retrieve the existent
relations through code dont forget to connect to CREO initially
The following code can be used to update the relations in CREO. Note that
textbox1 is a multiline textbox in which relations are entered. Alternately it can be
an array of string or a string with multiple lines when used internally
The above three methods show how easily we can edit designs in CREO
through VB.NET. In most of the cases a combination of these methods will be
used to edit the design.