Update View After Scale Change

Sep 19, 2006 1 Replies

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



found the answer myself. to anyone else searching use this

swView.UseSheetScale = True swView.UpdateViewDisplayGeometry

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required