13 Replies Latest reply on Dec 21, 2017 1:54 PM by Jacob Corder

    Macro feature main and rebuild question

    Fatih Mehmet Ozcan

      I have a macro feature in my drawing document. I use it to access custom properties and taking some actions according to their values

      When I use main sub when inserting macro feature, there is no problem but after reopening the document it gives an error. I am guessing that main sub doesn't work at reopening. Is macro feature not supposed work like normal macros?

       

      I tried to add some key statements to rebuild function like

      Set swApp = Application.SldWorks

      Set swmodel = swApp.ActiveDoc

      Set swcust = swmodel.Extension.CustomPropertyManager("")

      I am not sure this is good coding, I normally don't enter these in any function when working with macros

      But still there happens to be an error. If I ignore that error everything seems fine. This is because I thought main sub might be not working as should be in order. I tried writing On Error Resume Next but no avail

       

      Am I missing something? Should I return some values at swmRebulid?