Add rebuild function within the macro

Hi,

    Thanks to another post in the forum, I could get the macro that will help in deleting custom properties within the title block in a drawing. The macro runs fine and updates the title block, but I have to click on "rebuild" to ensure the changes are correctly reflected within the title block. Is there a way we can accomplish the rebuild within the macro itself rather than clicking on the button.

For you information here is the macro.

Sub main()

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

      If swModel Is Nothing Then MsgBox "A Part or Assembly file must be open", vbExclamation: End

    Set swCustPropMgr = swModel.Extension.CustomPropertyManager(Empty)

'------------------------------------------------------------------------------------------------------------------

Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")

       

swCustPropMgr.Delete "DRAWING-Finish"

             

MsgBox " Custom Property data updated."

End

End Sub

Thanks,

Ananth

SolidworksApi/macros