3 Replies Latest reply on Jul 3, 2014 11:38 PM by Ron Bates

    General drag/drop event from taskpane

    Ron Bates

      Is there any way to get a general event notification for file drop from an existing taskpane? 

        • Re: General drag/drop event from taskpane
          Keith Rice

          Ron,

           

          swAssyAddItemNotify or swPartAddItemNotify will fire if anything is added to the FeatureManager tree, regardless of the source. This includes dropping things from the task pane.

           

          As an example, at my web site is a macro called "Save component after dropped from task pane" that uses this notification.

           

          Keith

          SolidWorks API Video Tutorials

          • Re: General drag/drop event from taskpane
            Artem Taturevych

            Take a look to FileDropPostNotify event.

              • Re: General drag/drop event from taskpane
                Ron Bates

                Thanks Artem!  I don't know how I missed these event handlers in the docs...

                 

                So FileDropPostNotify is what I really want. But it only seems to work for solidworks file types.  ie my handler for DPartDocEvents_FileDropPostNotifyEventHandler is only called if I drop a sw file (like a part) from the design library or windows explorer...AND choose to create a derived part.  If I drag other types of files, my handler is not called.  I'm dragging other randome files into the scene from my own taskpane...so...

                 

                I do get my handler called for any type of file I drag, from FileDropPreNotify.  I may be able to use this with a bit more logic to store the filename whenever a drag into the document window is started.  But I'm not not sure it will work and certainly won't be as elegant as it would if I could rely on FileDropPostNotify to know my files were actually dropped!

                 

                Thanks again.