2 Replies Latest reply on Aug 29, 2012 8:46 AM by Daniel_T

    Automating "Replace Symbol/Part" tool with a script, DxDesigner PADS 9.4.1


      Hi there,

      To make a long story short we are in the process of migrating from DxDesigner PADS 2005.2 flow to the new iCDB version. At the same time we decided to update the symbol libraries to separate the "old" from the "new"...


      In this process I'm writing a script which goes through the design (in DxDesigner PADS9.4.1) component by component and replacing what is local symbols with the new library ones. Everything is working as i wish except when replacing symbols with multiple parts/slots.


      Heres a small part of the script:


      Component.Selected = True                                                        ' Selecting component to replace

      Component.SymbolBlock.ChangeComponentPreserveRefdes "< Selected Components >", newLibrarySymbolName          ' Replaces the selected component with the new library component


      Component.SymbolBlock.PromoteSymbolNumbers 1, compSlot                 ' first arg. is VDSELECTED, second arg is SLOT;     Generates the correct slot for the symbol


      Component.SymbolBlock.RepositionAttributesAsOnSymbol 1        ' arg is VDSELECTED;          Repositions the attributes as on the new library symbol

      Component.Selected = False                                                       ' De-selecting component after replacement


      I've understood that in order to even place a "slotted"/PARTS component with the pin numbers for only one part, I need to call the "PromoteSymbolNumbers" method (red line in example) on the symbol; and the arguments are not hard to understand... The problem for me is how do i find out what slot the symbol for the component i'm replacing is using before i call the "ChangeComponentPreserveRefdes" method so i can input this slot number into the second argument for the PromoteSymbolNumbers method? Is there any "GetSlot" method or "Slot" property that I've missed?


      Hope someone can help...

        • 1. Re: Automating "Replace Symbol/Part" tool with a script, DxDesigner PADS 9.4.1

          Hi Daniel,


          DxDesigner does not have a property for which slot a particular symbol instance is assigned.


          You'll need to look at the pin number instance values, and compare that to the library part definition.


          If you have pin numbers on the symbol, loop over the component connections, get the symbol pin, get the # attribute value, and split it into an array.


          The loop over the array, and when you find the component pin instance value, that is your slot number.


          If you do not have pin numbers on the symbol, like you may find with an Expedition Central Library, you will need to use the Parts database automation to traverse the mapping from a pin number to the slot.



          1 of 1 people found this helpful
          • 2. Re: Automating "Replace Symbol/Part" tool with a script, DxDesigner PADS 9.4.1

            Thanks for the reply John, so I did figure out a way to get the slot information from an underlying symbol but not exactly as you describe. The scripting function I made is based on the GetProjectData class. In this class one can use both the GetSlotsCount and GetPinNumbers methods to return the information needed to decide which slot a symbol instance is using. But one issue i have had is the "LibraryPartition" argument for both these methods. How do i specify this partition to a "Local project" symbol i.e. how should below call look?


            Application.GetProjectData.GetSlotsCount(<Local project library/partition>, Component.SymbolBlock.GetName(1), Component.SymbolBlock.SheetNum)