Update View After Scale Change

I am trying to change each view in a SolidWorks drawing to "Use sheet scale" instead of "Use custom scale" This code will do that, but after changing the property, the view is not updated. I can click on the view, and see that the "Use sheet scale" is selected. The view does not updated until I actually click on that button. I looked in SolidWorks API help, and it said to call Model.EditRebuild3() to rebuild the view, but it does not work. Anyone have any ideas?

Sub main() Dim SwApp As SldWorks.SldWorks Dim Model As SldWorks.ModelDoc2 Dim swView As SldWorks.View

Set SwApp = Application.SldWorks Set Model = SwApp.ActiveDoc

Set swView = Model.GetFirstView

Do While Not swView Is Nothing

Set swView = swView.GetNextView

swView.UseSheetScale = UseSheetScale

retval = Model.EditRebuild3()

Set swView = swView.GetNextView

Loop

End Sub

Reply to
inthepickle
Loading thread data ...

found the answer myself. to anyone else searching use this

swView.UseSheetScale = True swView.UpdateViewDisplayGeometry

Reply to
inthepickle

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.