1 Reply Latest reply on Dec 14, 2014 11:55 PM by James D

    ChangeCustomPropertyNotify fails to trigger after opening target document

    James D

      The code bellow triggers an event when it detects a change in the custom properties:

      The effect of it is, when I'm in an assembly and click on a sub-assembly/part and change it's custom properties an event is triggered.

       

          Public Function AssemblyDoc_ChangeCustomPropertyNotify(ByVal propName As System.String, ByVal Configuration As System.String, ByVal oldValue As System.String, _
                                                                 ByVal NewValue As System.String, ByVal valueType As System.Int32) As System.Int32
              MsgBox("Event Triggered!")

              'Other stuff
          End Function

       

      However,

      If I open up a sub-assembly/part document (and then close it)*

      and then change it's custom properties, the event dose not trigger for that particular sub-assembly/part

       

      BUT,

      If I do the same 'open/close' thing for another document, the trigger problem switches from the previously

      opened sub-assembly/part to this recently opened sub-assembly/part

       

      And, for some weird reason

      If I open the drawing document of the sub-assembly/part in question, everything works fine again

       

      NOTES:

      I'm using the SolidWorks API SDK 2011

      I'm changing the custom properties through 'Custom Properties Task Pane Tab'

      The MVS debugger does not turn up any errors

      I've tested this problem with AssemblyDoc_UserSelectionPostNotify() but it works fine

       

      *For some reason leaving the document open in the background dose not produce this problem