几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】how to find qantity in assm (http://www.dimcax.com/hust/showthread.php?t=5406)

yang686526 2009-04-13 11:57 AM

【转帖】how to find qantity in assm
 
how to find qantity # in assm
using modeldoc2.getdependencies2 returns an array of the parts used in an assembly. is there a command that will return the number of each part used in the assembly? such as if i know part x is used, is there a code to return the number of parts without traversing through the feature tree and counting the number of instances?
dan miel
2008 sp4
dan,
as far as i know, the only way to do it is to traverse the tree and count... it's not fun but it works. i did something like that. i populated a datagridview with different properties and the quantities from a given assembly. sounds like 2009 has a feature to display a bom in the assembly. maybe there is a new api that we can explore at release time...
tony szuta
cswa, cswp, cswp-smtl
tony is correct you will have to traverse but it is a very efficient process so i wouldn't worry about it
answer i suspected that was the case.
thanks for your anwers.
dan
edited: 09/04/2008 at 02:35 pm by dan miel
quick


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