Is there any way to update all sheets in a multiple page drawing file without doing them individually? The drawing file is quite big, 80meg.
Any way to rebuild a multiple sheet drawing file!
Nov 16, 2004
3 Replies
Have your tried using the Task Scheduler? Best Regards, Devon T. Sowell
formatting link
If you save it gives you the option. Does CTRL-Q do it.
Corey
Here's a macro I modified to do the job. It seems to be more thorough than the automatic options offered during saves and prints since I gave up on SW's ability to accurately know whether a sheet really needs to be updated. It also takes longer to run as a result...
I seem to recall that I lifted the guts of this from another macro. I think it was originally an example fle from SW.
Copy and paste into a new macro:
'traverses all views on all sheets, updating out of date views 'CHANGED TO FORCE UPDATE ALL VIEWS
Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2
Sub main()
Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc If swModel.GetType 3 Then swApp.SendMsgToUser "Run this on a .SLDDRW file, you silly person!" Exit Sub End If
Dim SheetNames As Variant Dim SheetCount As Integer Dim i As Integer Dim j As Integer Dim ActiveView As Object 'get all sheet names SheetNames = swModel.GetSheetNames 'get total number of sheets SheetCount = swModel.GetSheetCount For i = 0 To SheetCount - 1 ' active first sheet retval = swModel.ActivateSheet(SheetNames(i)) swModel.GraphicsRedraw2 'loop through all views ' Set ActiveView = swModel.GetFirstView ' Do While Not ActiveView Is Nothing ' Debug.Print ActiveView.IsModelOutOfDate ' If ActiveView.IsModelOutOfDate = True Then retval = swModel.ForceRebuild3(False) 'Rebuild(0) ' End If ' Set ActiveView = ActiveView.GetNextView ' Loop Debug.Print (i + 1) Next swApp.SendMsgToUser "View updates complete." ' 'Get the current sheet name ' CurrentSheetName = CurrentSheet.GetName Set ActiveView = Nothing Set ActiveNote = Nothing End Sub
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required