Generate Silkscreen Layer (with Refdes) from Component

Posted about 17 hours ago by Simon Garrison

Post a topic
Un Answered
S
Simon Garrison Admin

The follow Matrix script generates a very basic silkscreen from components - existing in the active Job.  (Requires FAB 3000 v8.10+)




<!-- 
Create Silkscreen Layer from components
Need App Examples or Learn More about the App Matrix format?

Visit, https://numericalinnovations.com/matrix-file-description -->
<NumericalMatrix text_height=".03" select_font="arial.fnt" top_side="true" bottom_side="true">

   <!-- Define a reference Array -->
    <REF name="top_silk_object">
    <ADD>
      <JOB>@active</JOB>
      <UNITS>INCH</UNITS>
      <COMPOSITE>dark</COMPOSITE>
      <TEXTSTYLE>@select_font</TEXTSTYLE>
      <TEXTALIGN>cc</TEXTALIGN>
      <TEXT>Silkscreen Top,__center_x,__center_y,@text_height,0,FALSE,__refdes,cc</TEXT>
    </ADD>
  </REF>
  
  <!-- Define a reference Array: For bottom Silktext -->
    <REF name="bottom_silk_object">
    <ADD>
      <JOB>@active</JOB>
      <UNITS>INCH</UNITS>
      <COMPOSITE>dark</COMPOSITE>
      <TEXTSTYLE>@select_font</TEXTSTYLE>
      <TEXTALIGN>cc</TEXTALIGN>
      <TEXT>Silkscreen Bottom,__center_x,__center_y,@text_height,0,TRUE,__refdes,cc</TEXT>
    </ADD>
  </REF>
   
  <!-- Add Modal dialog -->
  <DIALOGBOX title="Generate Silkscreen (from Components)..." width="400" height="200" columnWidth="180" help_url="">
    <DLGITEM name="Text Height" value="@text_height" type="edit" />
    <DLGITEM name="Text Font Style" value="@select_font" type="combo">
      <OPTION>fab.fnt</OPTION>
      <OPTION>arial.fnt</OPTION>
      <OPTION>times.fnt</OPTION>
    </DLGITEM>      
    <DLGITEM name="Add Silkscreen (Top Side)" value="@top_side" type="check" />
    <DLGITEM name="Add Silkscreen (Bottom Side)" value="@bottom_side" type="check" />
  </DIALOGBOX>  
  <EXIT if="__dlg_result==false"></EXIT>
  
  <!-- Select Top Layer Pads set -->
  <if test="@top_side==true">
    <FILTER>
      <NAME>top_filter</NAME>
      <JOB>@active</JOB>
      <LAYERS>[Top_Components]</LAYERS>
      <NewLayer result="@top_silk">Silkscreen Top,GRAPHIC</NewLayer>
    </FILTER>
    <SELECTION>
      <Name>top_set</Name>
      <FILTER>top_filter</FILTER>
      <JOB>@active</JOB>
      <SELECT_ALL/>
    </SELECTION>
    <foreach select="top_set">
      <get type="all" />
      <MESSAGE>#{{__index+1}}: __object (__refdes),  __layer, Center: __center_pt</MESSAGE>
      <matrix_ref name="top_silk_object" />
    </foreach>  
  </if>
  
  <!-- Process Bottom side -->
  <if test="@bottom_side==true">
    <FILTER>
      <NAME>bottom_filter</NAME>
      <JOB>@active</JOB>
      <LAYERS>[Bottom_Components]</LAYERS>
      <NewLayer result="@bot_silk">Silkscreen Bottom,GRAPHIC</NewLayer>
    </FILTER>
    <SELECTION>
      <Name>bottom_set</Name>
      <FILTER>bottom_filter</FILTER>
      <JOB>@active</JOB>
      <SELECT_ALL/>
    </SELECTION>  
    <foreach select="bottom_set">
      <get type="all" />
      <MESSAGE>#{{__index+1}}: __object (__refdes),  __layer, Center: __center_pt</MESSAGE>
      <matrix_ref name="bottom_silk_object" />
    </foreach>  
  </if>  
  
  <!-- Zoom Out to see edits -->
  <ZOOM_ALL />

</NumericalMatrix>


0 Votes


0 Comments

Login or Sign up to post a comment