1 Reply Latest reply on Dec 7, 2010 7:21 AM by john_dube

    Replace symbols in DxDesigner via Automation

    dirk_from_munich

      Sometimes I have more than one symbol for a part, e.g. a resistor or a capacitor is available as a horizontal (r.1) and vertical (r.2) symbol, or a component is divided into several gates (74LS04: 6 inverters, connectors etc.)

      rs.jpg

      Now, if I have to copy a symbol, change the gate or have to rotate it, I would like to have it replaced by the other symbol, where the text is properly aligned, instead of rotating it and re-arrange the properties. The "Replace symbol..." function is not useful, since I have to find the original component in the very big library again. In the good old DesignArchitect (Boardstation) we had a function called "Change part view", where we could select the views (orientation, mapping).

       

      Is there an easy way to add a RMB command to get the available symbols or gates, select and replace them without loosing any connectivity or property?

        • 1. Re: Replace symbols in DxDesigner via Automation
          john_dube

          Yes, you can define a custom menu entry for RMB (CommandBars("Component Popup").Controls.Add...)

           

          I'm not sure if you can make the sub-menu dynamically, it would be easier to have a fixed set of options (i.e. horizontal / vertical).  You can use the UpdateMethod property to dynamically enable/disable the submenu entries based on whether the symbols exist in the library.

           

          Then in the menu handler code when you know the symbol you want, call ChangeComponentPreserveRefdes.  Use "<Selected Components>" as the first argument.

           

          Depending on how different the symbols are, you may end up losing some connections, so you may want to query to the component connections before replacing the symbol, then repair any disconnections after the symbol is replaced.

           

          John