几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】propertyeditorglobal (http://www.dimcax.com/hust/showthread.php?t=5655)

yang686526 2009-04-13 01:43 PM

【转帖】propertyeditorglobal
 
propertyeditorglobal
i'm hoping someone here can help with me with an issue i'm having with this macro.
i have a large number of part files (~200) that i wish to add the property named "weight" to. the value for this will be the mass calculated by solidworks.
the problem i'm having is that in defining the properties to add via the macro i don't know what to enter for the value of this weight property. for instance, if i have a part open called part1, when i choose the mass in the drop-down list it is "sw-mass@@
i think this may help you. all the quotes are neccessary.
weight = """sw-mass@" & partno & ".sldprt"""
prop = swmodel.addcustominfo3(configuration_name, "weight", swcustominfotext, weight)

i forgot to mention that you must change partno and configuration_name to suit your needs.


所有的时间均为北京时间。 现在的时间是 09:08 PM.