6 Replies Latest reply on Apr 11, 2012 5:31 PM by nick_hong

    Renaming Padstack Names via Script in Library Manager


      I am writing a script that renames the padstacks in my library according to the IPC-7351 naming convention.  The script only runs with the padstack editor dialog box open.  It successfully renames the padstacks, but when I close the padstack editor dialog box, the cells no longer are associated with any of the renamed padstacks (cells are missing padstacks).  I tried the same script by opening the padstack editor dialog box in a Expedition design and running the script.  When I close the dialog box, an right-click on any padstack on the design, there is no name on the padstack.  If I open the Cell Editor dialog box in the Expedition design, I get a dialog "Replace Missing Padstacks" where I can associate the new padstack names with the old padstack names.


      Is there a way to keep this from happening from within the script?  If I manually change the name of a padstack in the padstack editor dialog, the new padstack name is updated in the cell.  But this is not what happens when a script changes the padstack name.



        • 1. Re: Renaming Padstack Names via Script in Library Manager

          I had this same problem in the Advance Library Edtior's padstack modificaiton. I had an option to go through and rename padstacks based on the objects that made up the padstack (Pad, hole, ect).


          Long story short, I couldn't figure out a way around it either...but know you are not the only one.



          1 of 1 people found this helpful
          • 2. Re: Renaming Padstack Names via Script in Library Manager

            You need to write a routine to scan all cells to assign correct padstack names after renaming the padstack names. I once wrote an Automation script to rename pads(http://communities.mentor.com/docs/DOC-2584); the script also have codes to fix pad names assigned to padstacks after changing pad names.



            • 3. Re: Renaming Padstack Names via Script in Library Manager

              Nick, I thought about that too.  However, I am somewhat new to scripting and I couldn't quite understand the documentation well enough to 1) scan the cells to determine what padstack(s) each one uses, and 2) change the padstack(s) that each one uses.  Do you have an example of how to read the padstacks of a cell and change them?



              • 4. Re: Renaming Padstack Names via Script in Library Manager

                Hi Patrick,


                Library Manager does not have direct access to each pins of specific cell. Instead, you can modify the pins by steps below.


                1. Get associated cells using Library Manager Automation -> Use 'Padstack.AssociatedCells'

                2. For Each cells found in step 1, open Cell Editor using Cell Editor Automation - Use 'Cell.Edit'

                3. In Cell Editor application, replace padstack using PCB Automation - Use 'Document.PutPadstack' & 'Pin.CurrentPadstack = ...'


                To make it clear, I am attaching two samples, one is for step 1 above and another for step 3.


                *** Backup your library database before running any script for the first time ***


                . Pstk2Cell.vbs is to get associated cells. It includes codes to run Library Manager application and open "C:\SampleLib2007\SampleLib.lms"(line 17). So please close all Library application, modify line 17 to indicate your LMC path, and run command as below

                   mgcscript ...\...\Pstk2Cell.vbs

                A prompt for padstack name will pop up. Just entering any padstack name will start searching associated partition:cells and write to the file at "C:\WDIR\Cell_Pstk.txt" (line 18)


                . EditPstk.vbs is to replace padstacks in active Cell Editor. It does not have code to invoke Cell Editor, so you should open Cell Editor before testing the code.

                Running EditPstk.vbs as internal client will replace padstack "RND0_7" with "RND1_4" (line 47). You will be able to notice the padstack is changing graphically on the fly.


                The codes are very simple, since I am just trying to share ideas to replace padstacks. You will need to complement the code to check various situation in order to secure your library database safely.


                Hope this could help...



                1 of 1 people found this helpful
                • 5. Re: Renaming Padstack Names via Script in Library Manager

                  Hi Nick,

                  Thank you for the examples.  Just one problem though...when I try to use the Padstack.AssociatedCells, I get an error message stating "Object doesn't support this property or method: 'oPadstack.AssociatedCells"  Is the AssociatedCells method supported in earlier or later versions only?  i am using EE7.9.2

                  • 6. Re: Renaming Padstack Names via Script in Library Manager

                    Hi Patrick,


                    Is the error with the example script Pstk2Cell.vbs? I tested it with EE7.9.2 and don't have any issue.


                    AssociatedCells is a property that is attached to Padstack Object in "Library Manager". If you tried Padstack.AssociatedCells for Padstack Object in PadstackEditor, you will get the error you mentioned since the object does not have AssociatedCells property.


                    If this is the case, please refer to 'Library Manager and Library Editors Automation Reference'(library_editors_auto.pdf) and find difference between below two objects

                      . Library Manager Objects - MGCLMPadstack Object

                      . Padstack Editor Objects - Padstack Object


                    - Nick