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.
- posted
19 years ago
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.
Have your tried using the Task Scheduler? Best Regards, Devon T. Sowell
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
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.