2 Replies Latest reply on Jul 14, 2010 2:54 AM by Alpha

    How can i edit a cell in Celleditor per Scripting ?

    Alpha


      hello dear members,


      I have an excel File with these Table:

      Padstack | Xlocation | Ylocation | Angle

      p1           |    x1          |  y1           | a1

       

      i want to place the the padstack p1 at the point (x1,y1) with the orientation a1 in Celleditor per Script.


      - Loading the data from excel ist not the problem.

      - Problem is that i am not finding a method to place the padstack in Celleditor.
        I have been trying with PutPadstack Method (Document Object) so far but it's not working.


      I will appreciate any help,

      thank you.

        • 1. Re: How can i edit a cell in Celleditor per Scripting ?
          Satoru

          Hello Alpha-san,

           

           

          I made a sample script.

          Please check it.

           

          Regards,

          Satoru

           

          ==============================================================

          Dim str
              Dim pdArr
              Dim pdStack
              Dim pns, pn
              Dim i

           

              Dim fso
              Set fso = CreateObject("Scripting.FileSystemObject")
              Scripting.AddTypeLibrary("Scripting.FileSystemObject")

           

              Dim file
              Set file = fso.OpenTextFile("C:\TEMP\place_pins.txt", ForReading)

           

              Do Until file.AtEndOfStream
                  str = file.ReadLine
                  i = i + 1
                  pdArr = Split(str, "|")

           

                  Set pdStack = pcbDoc.PutPadstack(1, pcbDoc.LayerCount, Trim(pdArr(0)))

           

                  Set pns = pcbDoc.Pins(epcbSelectAll)
                  If pns.Count >= i Then
                      Set pn = pns.Item(i)
                      pn.CurrentPadstack = pdStack
                      Call pn.Place(Trim(pdArr(1)), Trim(pdArr(2)), Trim(pdArr(3)))
                  End If
              Loop
              file.Close

          ==============================================================

          • 2. Re: How can i edit a cell in Celleditor per Scripting ?
            Alpha

            Hello Satorou,

            your answer was very helpfull.

            Thank you.