3 Replies Latest reply on Nov 26, 2010 4:09 AM by Satoru

    Dxdesigner delete properties by automation

    alain.maussion

      Hi

      I would like to delete some properties attach to symbol by automation.

      ex to remove older properties

       

      a function exist :

      attribute.delete()

       

      the problem is after to use this function the sytem report a error :

      Commit ICDB databse transaction rejected reloading project.

       

      do you have same example ?

        • 1. Re: Dxdesigner delete properties by automation
          Satoru

          Hi maussion-san,

           

          The deletion of the attribute is possible by such a code.

           

              Dim cmp
              Dim attr
              For Each cmp In dxdView.Query(VDM_COMP, VD_SELECTED)
                  Set attr = cmp.FindAttribute("Cost")
                  Call attr.Delete
              Next

           

          But the attribute put on the symbol can't be deleted.

           

          Regards,

          Satoru

          • 2. Re: Dxdesigner delete properties by automation
            alain.maussion

            Thanks

            For this script you use the technic of view so is necessary to open the schematic page before.

            is very slow when there are multi pages.

            do you have another technic wihtout open the schematic page ?

            Alain

            • 3. Re: Dxdesigner delete properties by automation
              Satoru

              Hello Alain-san,

               

              I'm sorry that a reply becomes slow.

              It can process fast by using the DesignComponents property.

               

              ===============================================================

              Dim designs, schName
              Dim cmp
              Dim attr

               

              Set designs = dxdApp.GetProjectData.GetiCDBDesigns()
              schName = dxdApp.GetProjectData.GetiCDBDesignRootBlock(designs.GetItem(1))

               

              For Each cmp In dxdApp.DesignComponents("", schName, -1, "STD", True)
                  Set attr = cmp.FindAttribute("Cost")
                  If Not attr Is Nothing Then
                      Call attr.Delete
                  End If
              Next

              ===============================================================

               

              Please try a sample script Type-2.

               

              Regards,

              Satoru