几何尺寸与公差论坛

 找回密码
 注册
查看: 622|回复: 0

【转帖】what is the api method that switches between sheets

[复制链接]
发表于 2009-4-12 22:51:13 | 显示全部楼层 |阅读模式
what is the api method that switches between sheets?
i am trying to figure out how to switch between different sheets in a drawing. say i am on sheet1 and want the macro to switch to sheet2.
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
look up "activate sheet" in the api help. you will need to know your sheet names if you want to cycle through them. there is a call for that as well... i believe it is getsheet.
to start your macro, try recording it and switch through your sheets.
dustin biber, pe
certified solidworks professional (cswp)
certified cosmosworks designer specialist (cswpcdes)
certified solidworks advanced sheet metal specialist (cswpsmtl)
answer originally posted by: dustin biber
look up "activate sheet" in the api help. you will need to know your sheet names if you want to cycle through them. there is a call for that as well... i believe it is getsheet.
to start your macro, try recording it and switch through your sheets.
recording myself switiching sheets didn't help.
i found an example that of something similar to what i am trying to do in the help file.
for other people reference, here is how you get the sheet name.
dim txtsheetname as string
dim swsheetname as sldworks.sheet
dim swapp as sldworks.sldworks
dim swdrawing as sldworks.modeldoc2
set swapp = application.sldworks
set swdrawing = swapp.activedoc
set swsheetname = swdrawing.getcurrentsheet
txtsheetname = swsheetname.getname
to switch to the original view do this :
bret = swdrawing.activatesheet(txtsheetname)
hope this helps anyone else in the future. i wish more people would post their findings rather than say nothing.
cswp
solidworks office professional 2008, sp 3.1
pc #1:
dell precision t3400, core2duo 2.33ghz, 4gb ram,
nvidia quadro fx 1700
pc #2:
dell precision 380, p4 3.80ghz, 2gb ram,
nvidia quadro fx 1400
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 19:44 , Processed in 0.034886 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表