From: inthepickle on 19 Sep 2006 10:21 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
From: inthepickle on 20 Sep 2006 15:02 found the answer myself. to anyone else searching use this swView.UseSheetScale = True swView.UpdateViewDisplayGeometry inthepickle wrote: > 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
|
Pages: 1 Prev: Align dimensions on Part and Assembly level Next: from solid to surface |