标题: VBA提取模型参数 [打印本页] 作者: heart_prc 时间: 2010-7-26 21:08 标题: VBA提取模型参数 最近开始研究VBA和PROE的二次开发,不通过第三方软件,求助,如何能提取模型的参数名称、值?作者: heart_prc 时间: 2010-7-27 11:00
没人知道吗?具体的说就是:
dim powner as ipfcparameterowner
dim para as ipfcbaseparameter
set powner=model
debug.pring powner.listparas.count '此句可得到模型中的参数的数量
但是继续往下走就没有相应的参数名和值的方法了作者: yue2233 时间: 2010-8-2 15:11
Dim ower As IpfcParameterOwner
Dim pro As IpfcParameter
Dim px As Double
ower = CType(model, IpfcParameterOwner)
pro = ower.GetParam("posx")
px=pro.GetScaledValue.DoubleValue '获取double类参数值作者: yue2233 时间: 2010-8-2 15:12
Private Sub setlen(ByVal name As String, ByVal var As String)
Dim prop As IpfcParameterOwner
Dim myprop As IpfcParameter
Dim myprop_v As IpfcParamValue
prop = CType(model, IpfcParameterOwner)
myprop = prop.GetParam(name)
myprop_v = pro_tool.createParamValueFromString(var)
myprop.SetScaledValue(myprop_v, Nothing)‘设置参数的值