4 Replies Latest reply on Aug 12, 2010 11:54 AM by Head1

    A mystery

    Head1

      Hello everybody in automation room,

       

      I try to write a simple code to build a BoardOutline + RouteOutline, when given

      x, y dimensions and offset between them. 

      ' =======================================================
      Private Sub Run_but_Click()

      Dim x, y, D


      Dim Arr()           ' BoardOutline   array
      Dim RO_Lst()    ' RouteOutline   array

       

      ReDim Arr(2, 4)        
      ReDim RO_Lst(2, 4)

       

      x = 75     ' X dimension for BoardOutline
      y = 60     ' Y dimension for BoardOutline
      D = 2      ' Clearance between BO and RO

       

      '       x               y                   R
      ' -------------------------------------------------
      Arr(0, 0) = 0: Arr(1, 0) = 0: Arr(2, 0) = 0
      Arr(0, 1) = 0: Arr(1, 1) = y: Arr(2, 1) = 0
      Arr(0, 2) = x: Arr(1, 2) = y: Arr(2, 2) = 0
      Arr(0, 3) = x: Arr(1, 3) = 0: Arr(2, 3) = 0
      Arr(0, 4) = 0: Arr(1, 4) = 0: Arr(2, 4) = 0

       

      My_Board.PutBoardOutline 5, Arr, 0, epcbUnitCurrent     ' Works fine.

       

       

      ' Assigning values to RouteOutline array (RO_lst)

      '       x                                            y                                         R
      ' --------------------------------------------------------------------------------------------------
      RO_Lst(0, 0) = Arr(0, 0) + D:  RO_Lst(1, 0) = Arr(1, 0) + D:  RO_Lst(2, 0) = 0
      RO_Lst(0, 1) = Arr(0, 1) + D:  RO_Lst(1, 1) = Arr(1, 1) - D:   RO_Lst(2, 1) = 0
      RO_Lst(0, 2) = Arr(0, 2) - D:   RO_Lst(1, 2) = Arr(1, 2) - D:   RO_Lst(2, 2) = 0
      RO_Lst(0, 3) = Arr(0, 3) - D:   RO_Lst(1, 3) = Arr(1, 3) + D:  RO_Lst(2, 3) = 0
      RO_Lst(0, 4) = Arr(0, 4) + D:  RO_Lst(1, 4) = Arr(1, 4) + D:  RO_Lst(2, 4) = 0

       

      My_Board.PutRouteBorder 5, RO_Lst, 0, epcbUnitCurrent      ' DOES NOT WORK
      End Sub
      ' ================================================

       

      So, the 2 "Put instructions" look the same. The first one works.

      The second one does not work. Please see attached error picture.

       

      More than this:  When I use array arr() for creating Routeoutline - IT WORKS.

                              When I use array RO_lst() for creating Routeoutline - IT DOES NOT WORKS,

                              and get the attached error.

       

       

      Is there anything I do not know about RouteOutline or  had a silly error, like most of times.

       

      Many thanks to all helpers and advisors.

       

                             Head1.

       

       

       

       

       

       

       

        • 1. Re: A mystery
          nick_hong

          Hello Head1,

           

          Your script works fine in my machine (EE 7.9 - WinXP, both in efm and vbs)

          Did you try modifying route outline manually, or running the script with a new, fresh design? it seems that there should be something that blocks modifying route outline in your design.

           

          Regards,

          Nick

           

          • 2. Re: A mystery
            Satoru

            Hi Head1-san,

             

            Is an error "DRC Violation"?

             

            If it's, a problem is avoidable by using TransactionStart Method.

             

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

            Private Sub Run_but_Click()
                Dim x, y, D
                Dim Arr()           ' BoardOutline   array
                Dim RO_Lst()    ' RouteOutline   array
                ReDim Arr(2, 4)       
                ReDim RO_Lst(2, 4)

             

                pcbDoc.TransactionStart(epcbDRCModeNoneWithBatchQuery)

             

                x = 75     ' X dimension for BoardOutline
                y = 60     ' Y dimension for BoardOutline
                D = 2      ' Clearance between BO and RO

             

                '       x               y                   R
                ' -------------------------------------------------
                Arr(0, 0) = 0: Arr(1, 0) = 0: Arr(2, 0) = 0
                Arr(0, 1) = 0: Arr(1, 1) = y: Arr(2, 1) = 0
                Arr(0, 2) = x: Arr(1, 2) = y: Arr(2, 2) = 0
                Arr(0, 3) = x: Arr(1, 3) = 0: Arr(2, 3) = 0
                Arr(0, 4) = 0: Arr(1, 4) = 0: Arr(2, 4) = 0

             

                Call pcbDoc.PutBoardOutline(5, Arr, 0, epcbUnitCurrent)

             


                ' Assigning values to RouteOutline array (RO_lst)
                '       x                                            y                                         R
                ' --------------------------------------------------------------------------------------------------
                RO_Lst(0, 0) = Arr(0, 0) + D:  RO_Lst(1, 0) = Arr(1, 0) + D:  RO_Lst(2, 0) = 0
                RO_Lst(0, 1) = Arr(0, 1) + D:  RO_Lst(1, 1) = Arr(1, 1) - D:  RO_Lst(2, 1) = 0
                RO_Lst(0, 2) = Arr(0, 2) - D:  RO_Lst(1, 2) = Arr(1, 2) - D:  RO_Lst(2, 2) = 0
                RO_Lst(0, 3) = Arr(0, 3) - D:  RO_Lst(1, 3) = Arr(1, 3) + D:  RO_Lst(2, 3) = 0
                RO_Lst(0, 4) = Arr(0, 4) + D:  RO_Lst(1, 4) = Arr(1, 4) + D:  RO_Lst(2, 4) = 0

             

                Call pcbDoc.PutRouteBorder(5, RO_Lst, 0, epcbUnitCurrent)

             

                pcbDoc.TransactionEnd

             

            End Sub

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

             

            Satoru

            • 3. Re: A mystery
              Andreas.Schaefer

              Hi Head1,

               

              first, you should define the units you use.

              Second, I would not use integers but floating numbers.

              Third, try to draw a user layer Gfx with your array RO_Lst, to see if the shape is the desired one

              and if the array itself is valid.

               

              And last but not least, I would recommend a different approach.

              Use the Automation Pro Mask engine.

              But the shape into a mask and oversize the mask with a negative value (will shrink it) and uese the rusulting array to draw the

              route Border.

               

              kind regards,

              Andreas

              • 4. Re: A mystery
                Head1

                Thanks to all helpers.

                 

                In short: With your assistance,the problem is solved.

                 

                Nick:

                   I already did what you adviced me. I checked the code on an empty board and it works.

                   When it does not work ? When the RouteBorder crosses a pad or component. This is for sure.

                 

                   But when I change MANUALLY the RouteBorder - it allows to cross pads.  Strange.

                 

                Satoru:

                  You gave me the best advice.

                  Your 2 lines solve the problem.

                         pcbDoc.TransactionStart(epcbDRCModeNoneWithBatchQuery)

                         pcbDoc.TransactionEnd

                 

                and the code works unconditionally good. Even if the RouteBorder crosses pads.

                I will use these line, although I do not understand them yet. Matter of learning.

                 

                Andreas:

                  You advide me a different approach.Using Pro mask engine.

                   I still have a lot to learn. This subject is one of them. I will try it in future.

                 

                 

                   Thanks to all of you.

                         Head1

                -------------------------------------------------

                 

                 

                 

                 

                 

                Message was edited by: Head1