4 Replies Latest reply on Mar 27, 2012 2:40 PM by rtennill

    add net to schematic by script?

    rtennill

      I'm using Pads Logic 9.2 and have been trying to come up with a method to add a net to an existing pin without having to edit the netlist directly. I know that there are methods to add gates and components to a sheet but I haven't stumbled across any sort of pin.AddNet method. My goal is to come up with a quick way to generate nets for high pin-count parts similar to how some popular FPGA schematic software adds port symbols for a block.

       

      Am I headed down a dead end by avoiding editing the netlist directly or have I simply missed a key method?

       

      my basic idea is:

       

      for all pins of a selected part

           if pin.name = null then

                set new_part = sheet.addComponent(StubPart,pin.name,pin.posX+offset,pin.posY+offset)

                set new_net = sheet.addNet(new_part, Selected_part)

           end if

      loop

       

      There would have to be some logic behind the posX+n statement to make sure that a net was added in the right direction since most parts have pins on more than one side.

      It would be even better if there was a way to just add the dangling net without adding part but this is what I came up with first.

       

      Looking forward to seeing what you all suggest!

        • 1. Re: add net to schematic by script?
          linlin893

          hi,rtennill

          can you know how to add net with script now? I try to add net with script,but it is not successful.  if you already know,please help me !

          thank you very much !

          • 2. Re: add net to schematic by script?
            olivier_arnaud

            Hi there,

             

            Please find an example of script to add different types of objects.

             

            I hope it helps!

            Cheers

            Olivier

             

             

            Option Explicit

             

             

            ' 1. Insert the border

            ActiveView.Block.InsertBorder

             

             

            ' 2. Add a couple of components, using AddPartInstance method

            Dim comp1 : Set comp1 = ActiveView.Block.AddPartInstance("Logic", "74AC08-SMD", "ac08", 300, 300)

            Dim comp2 : Set comp2 = ActiveView.Block.AddPartInstance("Discrete", "FZ", "res", 500, 500)

             

             

            ' 3. Add power tap

            Dim pwr : Set pwr = ActiveView.Block.AddSymbolInstance("Globals", "vcc", 500, 600)

            pwr.SymbolBlock.FindAttribute("Global Signal Name").Visible = VDVALUEVISIBLE

             

             

            ' 4. Add nets

            Dim net1 : Set net1 = ActiveView.Block.AddNet(380, 300, 500, 500, Nothing, Nothing, VD_WIRE)

            Dim net2 : Set net2 = ActiveView.Block.AddNet(500, 580, 500, 600, Nothing, Nothing, VD_WIRE)

             

             

            ' 5. Add text, with a box around it

            Dim txt1 : Set txt1 = ActiveView.Block.AddText("This circuit was built with a script", 200, 200)

            txt1.Size = 20

            Dim box1 : Set box1 = ActiveView.Block.AddBox(200, 200, 920, 220)

            box1.FillStyle = VDFILL_DIAGUP2

             

             

            ActiveView.Refresh

            • 3. Re: add net to schematic by script?
              linlin893

              hi,I'm so sorry to reply you now. I try to use your way, but it was not successful. In the PADS Logic,it's not this function with "activeview.block." .

              So,can you have a detailed example?  I need it. Thank you very much!

              • 4. Re: add net to schematic by script?
                rtennill

                Thanks for providing that bit of information. What software was that script intended for? It doesn't work in Pads Logic or at least my version of it which is 9.2.