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

yang686526 2009-04-13 08:39 AM

【转帖】active doc
 
active doc
i have used sw for about a month and am still a newbie here.
i downloaded some sample macros and am just wondering what the diff. between currentdoc and part???
set currentdoc = swapp.activedoc
set part = swapp.activedoc
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
the statement you are using is assigning a variable to the active document. without the code before these lines where it states dim currentdoc as ???, and dim part as ???, there is no difference.
i thought part is a predefined var. or sw keyword??? because i only saw currentdoc declared as object
public currentdoc as object
chris
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
nope part should be defined too. if they are not defined they are objects, so in this case they are both identical


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