2 Replies Latest reply on Sep 11, 2013 1:01 AM by charles.ietswaard1

    Resizing Refdes

    charles.ietswaard1

      Hello All,

       

      I anm working on a script that will resize the RefDes so that it will fit in the placement outline. (More or less like it used to be in  BoardStation).

       

      for each ComponentObj in ComponentsColl                                    

          set PlacementOutlinesColl = ComponentObj.PlacementOutlines        

          for each PlacementOutlineObj in PlacementOutlinesColl

       

          Height = PlacementOutlineObj.Extrema.MaxY - PlacementOutlineObj.Extrema.MinY

          Width  = PlacementOutlineObj.Extrema.MaxX - PlacementOutlineObj.Extrema.MinX

       

       

       

      You can set the height of the Refdes by using the ComponentObj.fabricationlayertexts.format.height value but you can not set the width, you can only set the aspect ratio.

      Has anyone a good suggestion on how to make sure that the Refdes wil fit in the assembly outline

       

       

      regards, Charles

        • 1. Re: Resizing Refdes
          matthias.cosaert

          Hi,

           

          The width depends on the number of characters in the Refdes, the font height and the type of font

           

          For most fonts the character width is about the same as the height (and the same for all characters) but not for all.

           

          Width = LEN(Refdes) * TextHeight  

           

           

           

          Example to calculate text height:

           

          TextHeight = Placementoutlinewidth / LEN(Refdes) 
          
          If textheight > placementoutlineHeight then
               TextHeight = placementoutlineHeight
          end if
          
          TextHeight = TextHeight * 0.9  'shrink 10%
          

          • 2. Re: Resizing Refdes
            charles.ietswaard1

            Hello  Matthias

             

             

            Your information helped me on finding a way to calculate the aspect ratio's for the Refdes. Now I can resize the refdes and it wil fit

            nicely inside the placement outline, more or less like it used to be in Boardstation.

             

             

            screen1.jpg

             

            Although there is an issue with non-rectangular outlines, but we will work on that.

             

             

             

             

             

            Thanks, Charles