3 Replies Latest reply on Nov 21, 2012 5:03 AM by john_dube

    How to find out when page is deleted in DxDesigner

    Andreas.Schaefer

      Hi,

       

      I would like to get a hint, which application event to use to find out when a page in scheamatic is deleted.

      When we aoutomate the page copy cprocess, pages are added to the collection an dwe can figuere out, which pages they were.

       

      But in navigator a page delete only changes the content of the SchematicSheetsCollection.

       

      The Application_Delete() event shows me, whenever a single objkect on a page (e.g. a net segment) is deleted.

      But it has no effect on changes of the SchematicSheet colelction or actions within the navigator.

       

      Any hint?

       

      Kind regards,

      Andreas

        • 1. Re: How to find out when page is deleted in DxDesigner
          john_dube

          Andreas,

           

          I am not aware of any event that is fired when a sheet is deleted.

           

          I think you'll need to sink some other event like ActivateView2 or DocumentClose, and check the schematic sheets collection to see if any sheets have been removed.

           

          John

          1 of 1 people found this helpful
          • 2. Re: How to find out when page is deleted in DxDesigner
            Andreas.Schaefer

            Hello John,

             

            this is the way I am already investigating, when deleting pages interactively.

            But I am confused by the results of Application.SchematicSheetDocuments.Count

             

            Scripting.DontExit = TRUE

             

            Set viewDrawApp = Application

            Set sheetsCollection = Application.SchematicSheetDocuments()

            sheetsCollectionCount = Application.SchematicSheetDocuments.Count

             

            Sub Application_AfterDocumentOpened(docType,LibraryAlias,objName)

                sheetsCollectionCountNow = Application.SchematicSheetDocuments.Count

                msgBox "AfterDocumentOpened" &" sheetsCollectionCountNow:" &sheetsCollectionCountNow

            End Sub

             

            Sub Application_ActivateView()

                sheetsCollectionCountNow = Application.SchematicSheetDocuments.Count

                msgBox "ActivateView" &" sheetsCollectionCountNow:" &sheetsCollectionCountNow

            End Sub


            Sub Application_DeactivateView()

                sheetsCollectionCountNow = Application.SchematicSheetDocuments.Count

                msgBox "DeactivateView" &" sheetsCollectionCountNow:" &sheetsCollectionCountNow

             

            End Sub

             

            When no  sheet is open in the main window and i delete a page in Navigator with  RMB-> delete

            the result of the

            Application.SchematicSheetDocuments.Count

            is 1 for Activate event and after the page deletion 0 inside the DeactivateView event sub.

             

            It looks for mee, that the collection does only include open pages. Is this true?

             

            greetings,

            Andreas

            • 3. Re: How to find out when page is deleted in DxDesigner
              john_dube

              Andreas,

               

              I think you want to use GetAvailableSchematics and GetAvailableSheets to count all the sheets in the project.

               

              John