Update View After Scale Change

Discussion in 'SolidWorks' started by inthepickle, Sep 19, 2006.

  1. inthepickle

    inthepickle Guest

    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
     
    inthepickle, Sep 19, 2006
    #1
  2. inthepickle

    inthepickle Guest

    found the answer myself. to anyone else searching use this

    swView.UseSheetScale = True
    swView.UpdateViewDisplayGeometry
     
    inthepickle, Sep 20, 2006
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.