2 Replies Latest reply on Jun 29, 2016 1:39 AM by gw@byk

    Automation in dxdesigner

    gw@byk

      Hi evryone,

       

      I'm wondering whether it is possible to trigger a script when closing a project - or the dxdesigner application. For Expedition I found "app.ProjectClosed" or "app.Shutdown" (looking for xDX - Project Close / Closing Event ). Within the "Documentation in InfoHub" I found "dxdesignerautomationoverview.pdf" but as far as I can see there is a "Shutdown" event but no "ProjectClosed" event.

       

      What I want to do is the following: whenever the project is closed (nevermind wheter caused due to changing the project or closing the application), I want RefDes to be assigned, the schematic to be exported to a pdf and the partlist to be updated.

       

      I'm very much obliged for any help,

       

      kind regards,

       

      Georg

        • 1. Re: Automation in dxdesigner
          matthias.cosaert

          Hello,

          you can use the BeforeProjectChanged() event, unlike the name suggest it also triggers when closing a project.

          It does not trigger when closing Dxdesigner so for for that you also need to use the shutdown() event.

           

          Example in vbscript:

           

           

           

          Scripting.AddTypeLibrary("ViewDraw.Application")

          Dim VdApp : Set VdApp = Application

          Call Scripting.AttachEvents(VdApp, "VdApp")
          Scripting.DontExit = True


          ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
          Sub VdApp_Shutdown()
          ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
          if Len(vdapp.GetProjectData().GetProjectPath) <> 0 then 'also triggers on opening a design
            msgbox "Shutdown" & vbnewline & "Active Design:" & vdapp.GetProjectData().GetProjectPath & "(" & vdapp.GetActiveDesign() & ")"
          end if
          End sub
          ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

           

          ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
          Sub VdApp_BeforeProjectChanged()
          ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
          if Len(vdapp.GetProjectData().GetProjectPath) <> 0 then 'also triggers on opening a design
            msgbox "Before project is closed" & vbnewline & "Active Design:" & vdapp.GetProjectData().GetProjectPath & "(" & vdapp.GetActiveDesign() & ")"
          end if
          End sub
          ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

           

          • 2. Re: Automation in dxdesigner
            gw@byk

            Hello,

             

            thank you very much for your reply. I just tried your suggestion, works fine!

             

            Kind Regards,

             

            Georg