11 Replies Latest reply on Dec 11, 2009 12:19 PM by Head1

    How to extract cell dimensions for all cells in board ?

    Head1

      Hello Everybody,

       

         I am going to write soon a program that requires the size (x,y dimensions) for some or all cells in board.

        My guess to find it was by looking  on members of a cell.

       

                          The menbers are : Name, CellType, Components, MountType   etc.

                                              But NOT anything like:  Width,  Xdimension, Length, X,Y ...

       

                          The attitude must be different. Can anybody help here?

       

                                                      Many thanks,

       

                                                                    Head1.

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

        • 1. Re: How to extract cell dimensions for all cells in board ?
          john_dube

          Take a look at the Extrema object.

           

          John

          • 2. Re: How to extract cell dimensions for all cells in board ?

            Look in your \SDD_HOME\standard\examples\pcb\Automation\Scripts\ directory, there is a script called AIS.vbs that gives you the Reference Designator, X/Y, Rotation, and side of each component.  This would probably be a good starting point for what you are wanting to do.  I have a custom version of this that adds in the Part Number and package name that I will gladly share with you if you are interested.

             

             

            Edit, sorry I reread what you were looking for and this won't be any help

            • 3. Re: How to extract cell dimensions for all cells in board ?
              Head1

              Hello Jeff,

               

                  Thanks for your answer.

                     The example you mentioned (AIS), deals with coordinates of parts in a design,

                     I am looking to PHYSICAL dimansions of cells. ( width and height ). It is not the same, of course.

               

                    Thanks you very much.

               

                                      Head1.

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

                    

              • 4. Re: How to extract cell dimensions for all cells in board ?

                Unfortunately, I realized that after I posted and there was no way to delete my post

                 

                I think the suggestion that John gave you using the  Extrema object is your best bet

                • 5. Re: How to extract cell dimensions for all cells in board ?
                  Head1

                  Hello Jeff and John,

                   

                     Thanks for your answers.

                      Unfortunately, Using Exterma is not the best solution to extract placement outline dimensions.

                      I did some investment and received the following dimensions with Exterma ;for a single cell.

                   

                      The results are:

                   

                      RES0402        W                    H
                  --------------------------------------------------
                         R60           2.127               1.127
                         R76           2.127               1.127
                         R83           2.127               1.127
                         R408         2.127               1.127
                         R834         2.127               1.127
                         R913         2.127               1.127
                         R1032       2.528               1.127
                         R1004       2.528               1.127
                         R1140       2.510               1.127
                         R1181       2.486               1.127
                         R1196       2.510               1.127
                         R1228       2.524               1.127
                         R1571       2.510               1.127
                         --------------------------------------------

                   

                  In other words: for the same cell, RES0402, I  get different results for different componets.

                  More then this: The greater the number of ref_des is, the greater is horizontal size !!

                  There is some link between them of course.

                   

                  Btw: The REAL size of  the placement outline is 2x1 mm ( and not 2.127 .....)

                   

                   

                  Anyway, I will try to find a better solution.

                   

                     Thanks to Jeff and John.

                   

                                            Head1

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

                   

                   

                   

                   

                   

                   

                   

                   

                  • 6. Re: How to extract cell dimensions for all cells in board ?
                    john_dube

                    Sounds like you are getting the extrema of the component, but you want the extrema of the placement outline only.

                     

                    Iterate over the Component.PlacementOutlines collection (in case there are multiple placement outlines for this cell), and record the extrema of the placement outline object.

                     

                    John

                    • 7. Re: How to extract cell dimensions for all cells in board ?
                      Head1

                      Hi John,

                       

                        I will try tomorrow:  Component > Placement outline , as you advised.

                       

                        In  my previous  message I wrote "investment" instead of "investigated" by mistake.

                        After all I was not born in Oxford...

                       

                              Thanks and All the best.

                       

                                               Head1

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

                      • 8. Re: How to extract cell dimensions for all cells in board ?
                        kendall_hiles

                        What is yor end goal,iIn other words what problem are you trying to solve?  Is it to find the area of all the components?  What does the final report you want look like?

                         

                        -kendall

                        • 9. Re: How to extract cell dimensions for all cells in board ?
                          Head1

                          Hi Kendall,

                           

                               The goal is simple to find the horizontal and vertical size of a cell.

                              ( ie dimensions of  placement outline of a cell).

                           

                                                       Thanks,

                                                        Head1

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

                              

                          • 10. Re: How to extract cell dimensions for all cells in board ?
                            kendall_hiles

                            You have two things to overcome.

                            1. some comps have more than one placement outline.

                            2. Not all placement outlines are rectangles they can be points arrays(Polygons)

                             

                            If you just want to make a rectangle out of a polygon try something like this (Added to the Height Report script)

                             

                                Dim po 'As PlacementOutline
                                Dim pos 'As PlacementOutlines

                             

                             

                             

                                        For Each po In pos
                                            xls.Range("C" & i).FormulaR1C1 = po.Height(epcbUnitCurrent)
                                            xls.Range("D" & i).FormulaR1C1 = po.UndersideSpace
                                            pntsarray = po.Geometry.PointsArray
                                           
                                            For j = 0 To UBound(pntsarray, 2)
                                           
                                                x = pntsarray(0, j)
                                                y = pntsarray(1, j)
                                               
                                                If j = 0 Then
                                                    MaxX = x
                                                    MinX = x
                                                    MaxY = y
                                                    MinY = y
                                                End If
                                           
                                                If x > MaxX Then
                                                    MaxX = x
                                                End If

                                                If x < MinX Then
                                                    MinX = x
                                                End If

                                                If y > MaxY Then
                                                    MaxY = y
                                                End If

                                                If y < MinY Then
                                                    MinY = y
                                                End If
                                              
                                            Next

                                            xls.Range("E" & i).FormulaR1C1 = MaxX - MinX
                                            xls.Range("F" & i).FormulaR1C1 = MaxY - MinY
                                        Next

                            • 11. Re: How to extract cell dimensions for all cells in board ?
                              Head1

                              Hi Kendall,

                                Thanks for your code. I will check it soon. ( On Sunday ).

                               

                                                   Bye,

                                               Head1.

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