![]() |
【转帖】api .name2 just changes in feature tree
api: .name2 just changes in feature tree
i have the following code that i wrote to rename the components in an assembly. when run the code the names change on the feature tree. it appears that the names are not really changing because you can rebuild and they revert back to old names. any ideas what i am doing wrong? set swapp = createobject("sldworks.application") swmodel.custominfo2("", "panelnumber") = panelid boldsetting = swapp.getuserpreferencetoggle_(swextrefupdatecompnames) 'debug.print boldsetting swapp.setuserpreferencetoggle swextrefupdatecompnames, false vchildcomparr = swcomp.getchildren for i = 0 to ubound(vchildcomparr) set swchildcomp = vchildcomparr(i) curname = swchildcomp.name2 newname = buildnewname(curname, panelid) 'debug.print newname bret = swchildcomp.select(false) 'debug.print bret swchildcomp.name2 = newname 'debug.print swchildcomp.name2 swmodel.custominfo2("", "panelnumber") = panelid next i swapp.setuserpreferencetoggle swextrefupdatecompnames,_ boldsetting posting in the eng-tips forums is a member-only feature. |
所有的时间均为北京时间。 现在的时间是 07:21 AM. |