PTC【Creo OR Proe】添加参数的方法

Dim model As IpfcModel
        Try
            model = CoCreoAsyncConnection.Session.CurrentModel
            If model Is Nothing Then
                Throw New Exception("Model not present")
            End If
            Dim pOwner As IpfcParameterOwner
            pOwner = CType(model, IpfcParameterOwner)
            Dim pv As IpfcParamValue
            Dim p As IpfcParameter
            pv = (New CMpfcModelItem).CreateStringParamValue("123")
            p = pOwner.GetParam("NAME")
            If p Is Nothing Then
                pOwner.CreateParam("NAME", pv)
            Else
                Dim LstrValue As String = p.GetScaledValue.StringValue
            End If
            run.createParametersFromProperties(model, model.Origin)
        Catch ex As Exception
            MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)
        End Try

posted on 2013-07-10 10:45  码农老K  阅读(851)  评论(0编辑  收藏  举报

导航