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

yang686526 2009-04-12 08:26 PM

【转帖】code example needed
 
code example needed
im editing a code to export a part model's flat pattern to a dwg, but i cant get it to save to a "user specified" location and also how can i get it to have the same file name as well?
im trying to find other codes already written but i cant find them and what i think would work isnt working
set part = swapp.activedoc
set selmgr = part.selectionmanager
boolstatus = part.extension.selectbyid2("flat-pattern1", "bodyfeature", 0, 0, 0, false, 0, nothing, 0)
boolstatus = part.exportflatpatternview("q:\wf (weigh and fill machines)\flat pattern - cylinder-bracket-table.dxf", 1)
end sub
just trying to figure it all out
my latest code but just seems to do nothing
sub main()
set swapp = application.sldworks
partname = swdescription
set part = swapp.activedoc
set selmgr = part.selectionmanager
boolstatus = part.extension.selectbyid2("flat-pattern1", "bodyfeature", 0, 0, 0, false, 0, nothing, 0)
boolstatus = part.exportflatpatternview("q:\ partname.dwg")
end sub
just trying to figure it all out


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