6 Replies Latest reply on Dec 10, 2014 6:27 AM by Pete

    Changing Component Names / Ref Des using scripts

    kjoubert

      I am attempting to write a script that will re-annotate the designators in a set pattern in Pads Layout so as to neaten the board design. I discovered that you can read the names using ActiveDocument.Components(x).Name, however it throws an error when I attempt to change the name by assigned that property a new text string (ActiveX Incorrect number of parameters). What must I do or what must I use to accomplish this?

       

      I am currently using Pads Layout vX.0

        • 1. Re: Changing Component Names / Ref Des using scripts
          Pete

          No need.  Use the Auto Renumber function in the ECO tools.

          1 of 1 people found this helpful
          • 2. Re: Changing Component Names / Ref Des using scripts
            kjoubert

            Thanks for that. I completely missed that tool. Still, for future reference, any suggestions regarding changing parameters via scripts? I see some older versions of PADS permitted changing attributes like parts names, label texts etc. but PADS VX.0 just throws errors. Some of the older scripts that used to work now also throw errors. Did MG change the scripting language?

            • 3. Re: Changing Component Names / Ref Des using scripts
              Pete

              Component.Name is a read only object in Layout.  (It is Read/Write in Logic)

               

              I haven't noticed any changes in script behavior since upgrading.  I don't think the language changed.  Most of the VX changes were in xDxDesigner.

              • 4. Re: Changing Component Names / Ref Des using scripts
                jim.granville

                Kirk Joubert wrote:

                 

                Thanks for that. I completely missed that tool. Still, for future reference, any suggestions regarding changing parameters via scripts?

                If you need more comprehensive changes than Script Access and the Auto tool allow, you can use the ECO pathway.

                This is a little more complex, as now your script creates an ECO ASCII file on disc, and imports that,

                Typically we do this in two passes, - rename all part with a leading underscore, then apply the new RefDes mapping you need.

                This is needed to avoid any state of two R33's, which will give a ECO error.

                This can be conditional - in one variant we add '_'  only to selected parts, and then rename only '_' tags, to get sub-boards as R100..R199 etc

                 

                I see some older versions of PADS permitted changing attributes like parts names, label texts etc. but PADS VX.0 just throws errors. Some of the older scripts that used to work now also throw errors. Did MG change the scripting language?

                Is it because some entities need to be ECO registered ?  I think the script access is unchanged ?

                • 5. Re: Changing Component Names / Ref Des using scripts
                  jim.granville

                  Pete wrote:

                  Component.Name is a read only object in Layout.  (It is Read/Write in Logic)

                   

                  It would be nice if the Script Read/Write ability was expanded, even it it needed a "I know what I am doing, and have a backup" tick

                  • 6. Re: Changing Component Names / Ref Des using scripts
                    Pete

                    I have found this task is easier to do in Logic, then forward annotate to Layout.  I also have a script that allows me to change one Ref Des at a time.  It's an active dialog box, acting on the selected part, which confirms a name swap if the name already exists.  I know, Logic already has the ability, this just saves me some clicks if I'm doing a bunch of parts manually.