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

作者:Joe.Fan
         
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/fanxingthink/p/4176161.html