查看单个帖子
旧 2009-04-13, 08:39 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)