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

转载于:https://www.cnblogs.com/fanxingthink/p/4176161.html

你可能感兴趣的:(PTC【Creo OR Proe】添加参数的方法)