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

yang686526 2009-04-12 10:58 PM

【转帖】add to new folder synta
 
"add to new folder" syntax
i just inserted a part into my assembly and stored the part's name as myinsrtprt and i want to create a new folder called "noz" and insert myinsrtpart into it.
i found insertsubfolder() for creating a subfolder and moving solid bodies or features into that folder, but those are for parts, and i can't find one for assemblies.
is this possible?
-wes
wes mosier
cswp in '03 & '08
.forefrontstudios.com
2009 premium x64 bit
answer never mind, i figured it out, and it works! thanks everybody.
boolstatus = assy.extension.selectbyid2(swcomp.name2 & "@" & swrootcomp.name2, "component", 0, 0, 0, false, 0, nothing, 0)
dim myfeature as object
set myfeature = assy.featuremanager.insertfeaturetreefolder2(swfeaturetreefoldertype_e.swfeaturetreefolder_containing)
boolstatus = assy.selectedfeatureproperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "noz")
wes mosier
cswp in '03 & '08
.forefrontstudios.com
2009 premium x64 bit
quick


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