2 Replies Latest reply on May 9, 2014 7:27 AM by Loui Leclerc

    Get filename or ID on task Add-In

    Loui Leclerc



      I am trying to get the filename, or the ID the file on wich a task was launched, either from your right click menu or a change state from the workflow. I see that they are stored in the ppodata, but can't seem to get them.


      I have a program that does all the work needed after this, but to launch it I need the filename of the mother file to which all others are referenced. For example, The document is an excel file in which I list all the new revisions and changes done to drawings. The Drawings are references to this file. So basically, I call the excel file, and it automatically gets latest on all DRWs, does the appropriate modifications (create pdf, add full size watermark on PDFs, and stores these.


      Thank you

        • Re: Get filename or ID on task Add-In
          Chris Cooke

          Hi Loui,


          There are  two ways of accessing the data stored in the ppoData Array. Firstly i will explain that the ppoData Array contains the EdmCmdData information, so this is what we are trying to access to get the information you need. It is worth noting that each hook, you have mentioned a menu command and state change hook, may pass different information from one another.


          Method Number 1:


          Loop through all objects (files for example) in the Array, assign the object to a variable and obtain direct access to the EdmCmdData members.


          foreach(EdmCmdData cmdData in ppoData)


               //For a menu command the fileID is stotred in mlObjectID1

               int fileID = cmdData.mlObjectID1;



          Method Number 2:


          Explicitly select an item in the Array and pass this to a variable:


          EdmCmdData cmdData =  ppoData.GetValue(0);

          //For a menu command the fileID is stotred in mlObjectID1

          int fileID = cmdData.mlObjectID1;


          If you search the EPDM API help document for EdmCmdData you should find all hooks and associated EdmCmdData members with the associated values.


          Many Thanks,