|
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 |
|