iCAx开思网

标题: SolidWorks 赋值零件自定义属性问题 [打印本页]

作者: 幻想柏拉图    时间: 2017-6-23 11:33
标题: SolidWorks 赋值零件自定义属性问题
blnretval = Part.AddCustomInfo3("", "宏代号", swCustomInfoText, e)
如何让Part.Extension.CustomPropertyManager("").Set("NO.", Left(Part.GetTitle, InStr(Part.GetTitle, " ") - 1))语句赋值到上示语句代码的e里面,总之就是在零件自定义属性里输入Part.Extension.CustomPropertyManager("").Set("NO.", Left(Part.GetTitle, InStr(Part.GetTitle, " ") - 1))公式
求大神指导,谢谢!!!!!!!!!!!!!!!!!!!!

作者: gt.adan    时间: 2017-6-23 12:26
本帖最后由 gt.adan 于 2017-6-23 12:34 编辑

建議改成如下:
  1.   blnretval = Part.DeleteCustomInfo2("", "宏代碼")
  2.   blnretval = Part.AddCustomInfo3("", "宏代碼", swCustomInfoText, "Part.Extension.CustomPropertyManager(" & chr(34) & ").Set(" & chr(34) & "NO." & chr(34) & ", Left(Part.GetTitle, InStr(Part.GetTitle," & chr(34) & " " & chr(34) & ") - 1))")
复制代码



作者: 幻想柏拉图    时间: 2017-6-26 15:18
gt.adan 发表于 2017-6-23 12:26
建議改成如下:

运行后得到:Part.Extension.CustomPropertyManager(").Set("NO.", Left(Part.GetTitle, InStr(Part.GetTitle," ") - 1))
实际应该是:Part.Extension.CustomPropertyManager("").Set("NO.",Left(Part.GetTitle,InStr(Part.GetTitle," ")-1))
有点看不懂啊!!!什么情况??????

作者: gt.adan    时间: 2017-6-26 16:16
[attach]1250340[/attach]
作者: 幻想柏拉图    时间: 2017-6-26 17:26
gt.adan 发表于 2017-6-26 16:16

哥们非常谢谢!
搞定了,学到了,很充实的感觉!

作者: JJM133144322    时间: 2017-6-27 13:36
帖子不能沉,求高手指点啊!!!!!!!!!!!





欢迎光临 iCAx开思网 (https://www.icax.org/) Powered by Discuz! X3.3