(ASCII Template "ADI's Res, thru, non-calculated, Aluminum-Housed, Wirewound")
(Version 1)
(Created 2002 02 07 12 00 00)
(Modifed 2002 02 07 12 00 00)
(Type "ThroughHole")
(Standard "ADI Through Hole Standard")
(Style "Discrete, Resistor")
(Family "ADI_Standard")
(Revision "A1")
(Creater "Accelerated Designs, Inc.")
(Comment "KTS.  06-13-2014.  Changed template title, description.")
(Comment "JRR. 11-11-2014. MISC")
(Units Mil)
(Description "This template will build a thru-hole, aluminum-housed, axial lead, wirewound resistor.  Pad dimensions are user-entered.")
(Image "ADI_res_al_housed3.gif")
(Image "ADI_res_al_housed2.gif")
(Variables
    #Variables
    (String "Specific Name:" 'NAME' "")
    (Comment "Part Information")
    (Number "Lead Spacing : LS " 'LS' 1187)
    (Number "Body Width : BW " 'BW' 631)
    (Number "Body Height : BH " 'BH' 349)
    (Number "Max Height : BH2 " 'BH2' 661)
    (Number "Mounting Tab Width" 'MTW' 176)
    (Number "Component Height(Z): CHGT" 'CHGT' 335)
    (Number "Component Minimum Height(Z): CMHGT " 'CMHGT' 10)
    (Comment "Pin Information")
    (StringList "Pin 1 Shape" 'PSH1' "Square" "Round" "Rectangle" "Oblong")
    (Number "Pin 1 Drill Size: DRL1" 'DRL1' 40)
    (Number "Pin 1 Width: PAD1W" 'PAD1W' 60)
    (Number "Pin 1 Height: PAD1H" 'PAD1H' 60)
    (Stringlist "Pin 1 Lead Shape" 'LEAD_SHAPE1' "Round" "Rectangular")
    (Number "Pin 1 Lead X-Size: LEAD_SIZE1" 'LEAD_SIZE1' 0)
    (Number "Pin 1 Lead Y-Size: LEAD_SIZE1_Y" 'LEAD_SIZE1_Y' 0)
    (StringList "Default Pad Shape" 'PSH' "Round" "Oblong" "Square" "Rectangle")
    (Number "Default Drill Size: DRL" 'DRL' 40)
    (Number "Default Width: PADW" 'PADW' 60)
    (Number "Default Height: PADH" 'PADH' 60)
    (Stringlist "Default Lead Shape" 'LEAD_SHAPE' "Round" "Rectangular")
    (Number "Default Lead X-Size: LEAD_SIZE" 'LEAD_SIZE' 0)
    (Number "Default Lead Y-Size: LEAD_SIZE_Y" 'LEAD_SIZE_Y' 0)
    (Comment "Mounting Hole Information")
    (Check "Plated Mounting Holes" 'MP' 0)
    (Number "Mounting Horiz Spacing" 'MHS' 448.81)
    (Number "Mounting Vert Spacing" 'MVS' 494.88)
    (StringList "Mounting Pad Shape" 'MPSH' "Round" "Oblong" "Square" "Rectangle")
    (Number "Mounting Pad Drill Size: MDRL" 'MDRL' 99)
    (Number "Mounting Pad Width: MPADW" 'MPADW' 119)
    (Number "Mounting Pad Height: MPADH" 'MPADH' 119)
    (Comment "Alt Pad Style 1")
    (StringList "Pad Shape: A1_PSH" 'A1_PSH' "Oblong" "Round" "Rectangle" "Square")
    (Number "Pad Width: A1_PADW " 'A1_PADW' 60)
    (Number "Pad Height: A1_PADH " 'A1_PADH' 90)
    (Number "Drill Size: A1_DRL " 'A1_DRL' 30)
    (Temporary String "altpadstack1" 'A1_Pad' "A1_Pad")
    (Comment "Alt Pad Style 2")
    (StringList "Pad Shape: A2_PSH" 'A2_PSH' "Oblong" "Round" "Rectangle" "Square")
    (Number "Pad Width: A2_PADW " 'A2_PADW' 90)
    (Number "Pad Height: A2_PADH " 'A2_PADH' 60)
    (Number "Drill Size: A2_DRL " 'A2_DRL' 30)
    (Temporary String "altpadstack2" 'A2_Pad' "A2_Pad")
    (Comment "Documentation")
    (OptionList "Pin 1 Marker" 'M' "Plus" "Dot" "Stripe" "Diode" "None")
    (Number "Marker Size" 'MS' 50)
    (CountList "Pattern Rotation" 'PROT' 0 90 180 270)
    (String "Revision Level: REVLEVEL " 'REVLEVEL' "A0")
    (Comment "Footprint Naming")
    (String "Name Suffix SUFFIX: " 'SUFFIX' "")
    #Temporary Variables
    (Temporary Number "dimension width" 'DW' 0)
    (Temporary Number "Assembly  Width" 'AW' 0)
    (Temporary Number "Silk  Width" 'SW' 6)
    (Temporary Number "Marker Flag" 'MF' 0)
    (Temporary String "polarity flag" 'POL' "P")
    (Temporary Number "Body left" 'L' 0)
    (Temporary Number "Body right" 'R' 0)
    (Temporary Number "Body top" 'T' 0)
    (Temporary Number "Body bottom" 'B' 0)
    (Temporary Number "Marker Coord" 'MX' 0)
    (Temporary String "Padstyle1" 'PS1' "")
    (Temporary String "Padstyle2" 'PS2' "")
    (Temporary String "Mounting Padstyle" 'MPAD' "")
    (Temporary Number "extent bottom" 'EB' 0)
    (Temporary Number "Origin X1" 'ORX1' 0)
    (Temporary Number "Origin Y1" 'ORY1' 0)
    (Temporary Number "Origin X2" 'ORX2' 0)
    (Temporary Number "Origin Y2" 'ORY2' 0)
    (Temporary String "NNAME" 'NNAME' "")
    (Temporary Number "Courtyard height" 'G1' 0)
    (Temporary Number "Courtyard width" 'G2' 0)
    (Temporary Number "Courtyard Excess" 'CE' 10)
    (Temporary Number "NoProbeHor" 'NPH' 850)
    (Temporary Number "NoProbeVertical" 'NPV' 850)
    (Temporary Number "Text Rotation Value" 'TRO' 0)
    (Temporary Number "NEW PADW" 'NEW_PADW' 0)
    (Temporary Number "NEW PADH" 'NEW_PADH' 0)
    (Temporary Number "NEW DRL" 'NEW_DRL' 0)
    (Temporary Number "NEW PAD1W" 'NEW_PAD1W' 0)
    (Temporary Number "NEW PAD1H" 'NEW_PAD1H' 0)
    (Temporary Number "NEW DRL1" 'NEW_DRL1' 0)
)
(Part
    #Calculations
    ##Drill and Pad calculations for Pin 1
    (Script "GP_Drill_Pad_cal.vbs"
        (Variable 'LSHAPE' [String='LEAD_SHAPE1'])
        (Variable 'LEAD_X' [Number='LEAD_SIZE1'])
        (Variable 'LEAD_Y' [Number='LEAD_SIZE1_Y'])
        (Variable 'DRILL_INC' [Number=10])
        (Variable 'PAD_INC' [Number=20])
        (ReturnValue 'NEW_DRL' 'NEW_DRL')
        (ReturnValue 'NEW_PADW' 'NEW_PADW')
        (ReturnValue 'NEW_PADH' 'NEW_PADH')
    )
    #Transfer values to Pin 1 variables first
    (Variable 'NEW_DRL1' [Number='NEW_DRL'])
    (Variable 'NEW_PAD1W' [Number='NEW_PADW'])
    (Variable 'NEW_PAD1H' [Number='NEW_PADH'])
    #Overwrite the variables if the lead size is set to zero.
    (Variable 'NEW_DRL1' [Number='DRL1']
        (DoIf [Number='LEAD_SIZE1']=[Number=0])
    )
    (Variable 'NEW_PAD1W' [Number='PAD1W']
        (DoIf [Number='LEAD_SIZE1']=[Number=0])
    )
    (Variable 'NEW_PAD1H' [Number='PAD1H']
        (DoIf [Number='LEAD_SIZE1']=[Number=0])
    )
    ##Drill and Pad calculations for Pin 2
    (Script "GP_Drill_Pad_cal.vbs"
        (Variable 'LSHAPE' [String='LEAD_SHAPE'])
        (Variable 'LEAD_X' [Number='LEAD_SIZE'])
        (Variable 'LEAD_Y' [Number='LEAD_SIZE_Y'])
        (Variable 'DRILL_INC' [Number=10])
        (Variable 'PAD_INC' [Number=20])
        (ReturnValue 'NEW_DRL' 'NEW_DRL')
        (ReturnValue 'NEW_PADW' 'NEW_PADW')
        (ReturnValue 'NEW_PADH' 'NEW_PADH')
    )
    #Overwrite the variables if the lead size is set to zero.
    (Variable 'NEW_DRL' [Number='DRL']
        (DoIf [Number='LEAD_SIZE']=[Number=0])
    )
    (Variable 'NEW_PADW' [Number='PADW']
        (DoIf [Number='LEAD_SIZE']=[Number=0])
    )
    (Variable 'NEW_PADH' [Number='PADH']
        (DoIf [Number='LEAD_SIZE']=[Number=0])
    )
    ## Padstack Naming
    (Group "GP_PadStyleName.adg"
        (Variable 'GP_PSH' [String='PSH1'])
        (Variable 'GP_PADW' [Number='NEW_PAD1W'])
        (Variable 'GP_PADH' [Number='NEW_PAD1H'])
        (Variable 'GP_DRL' [Number='NEW_DRL1'])
        (ReturnValue 'PS1' 'GP_PADNAME')
    )
    (Group "GP_PadStyleName.adg"
        (Variable 'GP_PSH' [String='PSH'])
        (Variable 'GP_PADW' [Number='NEW_PADW'])
        (Variable 'GP_PADH' [Number='NEW_PADH'])
        (Variable 'GP_DRL' [Number='NEW_DRL'])
        (ReturnValue 'PS2' 'GP_PADNAME')
    )
    (Group "GP_PadStyleName.adg"
        (Variable 'PGP_SH' [String='MPSH'])
        (Variable 'GP_PADW' [Number='MPADW'])
        (Variable 'GP_PADH' [Number='MPADH'])
        (Variable 'GP_DRL' [Number='MDRL'])
        (ReturnValue 'MPAD' 'GP_PADNAME')
    )
    (Group "GP_PadStyleName.adg"
        (Variable 'GP_PSH' [String='A1_PSH'])
        (Variable 'GP_PADW' [Number='A1_PADW'])
        (Variable 'GP_PADH' [Number='A1_PADH'])
        (Variable 'GP_DRL' [Number='A1_DRL'])
        (ReturnValue 'A1_Pad' 'GP_PADNAME')
    )
    (Group "GP_PadStyleName.adg"
        (Variable 'GP_PSH' [String='A2_PSH'])
        (Variable 'GP_PADW' [Number='A2_PADW'])
        (Variable 'GP_PADH' [Number='A2_PADH'])
        (Variable 'GP_DRL' [Number='A2_DRL'])
        (ReturnValue 'A2_Pad' 'GP_PADNAME')
    )
    (Variable 'MF' [Number=0]
        (DoIf [String='M']=[String="None"])
    )
    (Variable 'MF' [Number='MS']
        (DoIf [String='M']<>[String="None"])
    )
    (Variable 'EB' [Number=0-'NEW_PAD1H']
        (DoIf [Number='NEW_PAD1H']=>[Number='BH'/2])
    )
    (Variable 'EB' [Number=0-'BH2'/2]
        (DoIf [Number='NEW_PAD1H']<[Number='BH2'/2])
    )
    (Variable 'POL' [String="P"]
        (DoIf [String='M']<>[String="None"])
    )
    (Variable 'POL' [String=""]
        (DoIf [String='M']=[String="None"])
    )
    (Variable 'MX' [Number=0-'LS'/2-'NEW_PAD1W'/2-'MS'/2-10])
    (Variable 'L' [Number=0-'BW'/2])
    (Variable 'R' [Number='BW'/2])
    (Variable 'T' [Number='BH'/2])
    (Variable 'B' [Number=0-'BH'/2])
    ## PlaceBound Calculations
    (Variable 'G2' [Number=('BH2'+(2*'CE'))])
    (Variable 'G1' [Number=('LS'+'NEW_PADW'+(2*'CE'))])
    ## No Probe Calculations.
    (Variable 'NPH' [Number=('LS')+30+'NEW_PADW']
        (DoIf [Number='CHGT']<=[Number=250])
    )
    (Variable 'NPV' [Number='BH2'+30]
        (DoIf [Number='CHGT']<=[Number=250])
    )
    (Variable 'NPH' [Number=('LS')+250+'NEW_PADW']
        (DoIf [Number='CHGT']>[Number=250])
    )
    (Variable 'NPV' [Number='BH2'+250]
        (DoIf [Number='CHGT']>[Number=250])
    )
    ## Text Rotation Calculation
    (Variable 'TRO' [Number=0]
        (DoIf [Number='PROT']=[Number=0])
    )
    (Variable 'TRO' [Number=270]
        (DoIf [Number='PROT']=[Number=90])
    )
    (Variable 'TRO' [Number=180]
        (DoIf [Number='PROT']=[Number=180])
    )
    (Variable 'TRO' [Number=90]
        (DoIf [Number='PROT']=[Number=270])
    )
    # Part Data (glue dots, origin, pickpoints, Rotation, etc.
    ## Pad Style Definitions
    (PadStyleDefinition
        (Name [String='PS1'])
        (Drill [Number='NEW_DRL1'])
        (Plated True)
        (Shape (Layer TOP) [String='PSH1'] [Number='NEW_PAD1W'] [Number='NEW_PAD1H'])
    )
    (PadStyleDefinition
        (Doif [String='PS1']<>[String'PS2'])
        (Name [String='PS2'])
        (Drill [Number='NEW_DRL'])
        (Plated True)
        (Shape (Layer TOP) [String='PSH'] [Number='NEW_PADW'] [Number='NEW_PADH'])
    )
    (PadStyleDefinition
        (Name [String='MPAD'])
        (Drill [Number='MDRL'-'MDRL'-'MDRL'])
        (Plated False)
        (Shape (Layer TOP) [String='MPSH'] [Number='MPADW'] [Number='MPADH'])
        (DoIf [Number='MP']=[Number=0])
    )
    (PadStyleDefinition
        (Name [String='MPAD'])
        (Drill [Number='MDRL'])
        (Plated True)
        (Shape (Layer TOP) [String='MPSH'] [Number='MPADW'] [Number='MPADH'])
        (DoIf [Number='MP']<>[Number=0])
    )
    (PadStyleDefinition
        (Name [String='A1_Pad'])
        (Drill [Number='A1_DRL'])
        (Plated True)
        (Shape (Layer TOP) [String='A1_PSH'] [Number='A1_PADW'] [Number='A1_PADH'])
        (AlternateNumber 1)
    )
    (PadStyleDefinition
        (Name [String='A2_Pad'])
        (Drill [Number='A2_DRL'])
        (Plated True)
        (Shape (Layer TOP) [String='A2_PSH'] [Number='A2_PADW'] [Number='A2_PADH'])
        (AlternateNumber 2)
    )
    ## Pin Locations
    (Pin
        (Name "1")
        (Designator "1")
        (PadStyle [String='PS1'])
        (Origin [Number=0-'LS'/2] 0)
        (Rotation 0)
    )
    (Pin
        (Name "2")
        (Designator "2")
        (PadStyle [String='PS2'])
        (Origin [Number='LS'/2] 0)
        (Rotation 180)
    )
    (Pin
        (Name "3")
        (Designator "3")
        (PadStyle [String='MPAD'])
        (Origin [Number=0-'MHS'/2] [Number=0-'MVS'/2])
        (Rotation 0)
    )
    (Pin
        (Name "4")
        (Designator "4")
        (PadStyle [String='MPAD'])
        (Origin [Number='MHS'/2] [Number='MVS'/2])
        (Rotation 0)
    )
    ## 3D Polygon
    (Polygon
        (Layer 3D_DXF)
        (Type Polygon)
        (Point [Number=0-'BW'/2] [Number=0-('BH'/2)])
        (Point [Number=0-'BW'/2] [Number=0-('BH2'/2)])
        (Point [Number=0-'BW'/2+'MTW'] [Number=0-('BH2'/2)])
        (Point [Number=0-'BW'/2+'MTW'] [Number=0-('BH'/2)])
        (Property [String="HEIGHTRANGE='CMHGT','CHGT'"])
    )
    (Polygon
        (Layer 3D_DXF)
        (Type Polygon)
        (Point [Number='BW'/2] [Number='BH'/2])
        (Point [Number='BW'/2] [Number='BH2'/2])
        (Point [Number='BW'/2-'MTW'] [Number='BH2'/2])
        (Point [Number='BW'/2-'MTW'] [Number='BH'/2])
        (Property [String="HEIGHTRANGE='CMHGT','CHGT'"])
    )
    ## Keep Out
    (Polygon
        (Layer TOP)
        (Type KeepOut)
        (Point [Number=0-'BW'/2] [Number='BH'/2])
        (Point [Number='BW'/2] [Number='BH'/2])
        (Point [Number='BW'/2] [Number=0-'BH'/2])
        (Point [Number=0-'BW'/2] [Number=0-'BH'/2])
    )
    (Polygon
        (Layer TOP)
        (Type KeepOut)
        (Point [Number=0-'BW'/2] [Number=0-'BH'/2])
        (Point [Number=0-'BW'/2] [Number=0-'BH2'/2])
        (Point [Number=0-'BW'/2+'MTW'] [Number=0-'BH2'/2])
        (Point [Number=0-'BW'/2+'MTW'] [Number=0-'BH'/2])
    )
    (Polygon
        (Layer TOP)
        (Type KeepOut)
        (Point [Number='BW'/2] [Number='BH'/2])
        (Point [Number='BW'/2] [Number='BH2'/2])
        (Point [Number='BW'/2-'MTW'] [Number='BH2'/2])
        (Point [Number='BW'/2-'MTW'] [Number='BH'/2])
    )
    ## PlaceBound Description
    (Line
        (Layer TOP_PLACE_BOUND)
        (Origin [Number=0-'G1'/2] [Number=0-'G2'/2])
        (EndPoint [Number=0-'G1'/2] [Number='G2'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_PLACE_BOUND)
        (Origin [Number=0-'G1'/2] [Number='G2'/2])
        (EndPoint [Number='G1'/2] [Number='G2'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_PLACE_BOUND)
        (Origin [Number='G1'/2] [Number='G2'/2])
        (EndPoint [Number='G1'/2] [Number=0-'G2'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_PLACE_BOUND)
        (Origin [Number='G1'/2] [Number=0-'G2'/2])
        (EndPoint [Number=0-'G1'/2] [Number=0-'G2'/2])
        (Width [Number='SW'])
    )
    (Polygon
        (Layer TOP_PLACE_BOUND)
        (Type Polygon)
        (Point [Number=0-'G1'/2] [Number=0-'G2'/2])
        (Point [Number=0-'G1'/2] [Number='G2'/2])
        (Point [Number='G1'/2] [Number='G2'/2])
        (Point [Number='G1'/2] [Number=0-'G2'/2])
    )
    ##Body PlaceBound Description
    (Line
        (Layer PLACEMENT_BODY)
        (Origin [Number=0-'BW'/2] [Number=0-'BH'/2])
        (EndPoint [Number=0-'BW'/2] [Number='BH'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PLACEMENT_BODY)
        (Origin [Number=0-'BW'/2] [Number='BH'/2])
        (EndPoint [Number='BW'/2] [Number='BH'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PLACEMENT_BODY)
        (Origin [Number='BW'/2] [Number='BH'/2])
        (EndPoint [Number='BW'/2] [Number=0-'BH'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PLACEMENT_BODY)
        (Origin [Number='BW'/2] [Number=0-'BH'/2])
        (EndPoint [Number=0-'BW'/2] [Number=0-'BH'/2])
        (Width [Number='SW'])
    )
    (Polygon
        (Layer PLACEMENT_BODY)
        (Type Polygon)
        (Point [Number=0-'BW'/2] [Number=0-'BH'/2])
        (Point [Number=0-'BW'/2] [Number='BH'/2])
        (Point [Number='BW'/2] [Number='BH'/2])
        (Point [Number='BW'/2] [Number=0-'BH'/2])
    )
    ###PlaceBound NCE Description
    (Line
        (Layer TOP_PLACEBOUND_3)
        (Origin [Number=0-'G1'/2+'CE'] [Number=0-'G2'/2+'CE'])
        (EndPoint [Number=0-'G1'/2+'CE'] [Number='G2'/2-'CE'])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_PLACEBOUND_3)
        (Width [Number='SW'])
        (Origin [Number=0-'G1'/2+'CE'] [Number='G2'/2-'CE'])
        (EndPoint [Number='G1'/2-'CE'] [Number='G2'/2-'CE'])
    )
    (Line
        (Layer TOP_PLACEBOUND_3)
        (Width [Number='SW'])
        (Origin [Number='G1'/2-'CE'] [Number='G2'/2-'CE'])
        (EndPoint [Number='G1'/2-'CE'] [Number=0-'G2'/2+'CE'])
    )
    (Line
        (Layer TOP_PLACEBOUND_3)
        (Width [Number='SW'])
        (Origin [Number='G1'/2-'CE'] [Number=0-'G2'/2+'CE'])
        (EndPoint [Number=0-'G1'/2+'CE'] [Number=0-'G2'/2+'CE'])
    )
    (Polygon
        (Layer TOP_PLACEBOUND_3)
        (Type Polygon)
        (Point [Number=0-'G1'/2+'CE'] [Number=0-'G2'/2+'CE'])
        (Point [Number=0-'G1'/2+'CE'] [Number='G2'/2-'CE'])
        (Point [Number='G1'/2-'CE'] [Number='G2'/2-'CE'])
        (Point [Number='G1'/2-'CE'] [Number=0-'G2'/2+'CE'])
    )
    ### Valor Boundary Description
    (Group "GP_HP_Valor.adg"
        (Variable 'GP_LEFT' [Number=0-('LS'+'NEW_PADW')/2])
        (Variable 'GP_RIGHT' [Number=('LS'+'NEW_PADW')/2])
        (Variable 'GP_TOP' [Number='BH2'/2])
        (Variable 'GP_BOTTOM' [Number=0-('BH2'/2)])
        (Variable 'GP_HOVER' [Number=25])
        (Variable 'GP_VOVER' [Number=25])
    )
    ## No Probe shape description.
    (Polygon
        (Layer TOP_NO-PROBE)
        (Type Polygon)
        (Point [Number=0-'NPH'/2] [Number=0-'NPV'/2])
        (Point [Number=0-'NPH'/2] [Number='NPV'/2])
        (Point [Number='NPH'/2] [Number='NPV'/2])
        (Point [Number='NPH'/2] [Number=0-'NPV'/2])
    )
    ## ProE Data
    (Attribute
        (Layer PRO_E)
        (Origin 0 0)
        (Rotation 0)
        (TextStyle "H50S3")
        (Justify Center)
        (Visible False)
        (Name "Height")
        (Data [String='CHGT'])
    )
    (Attribute
        (Layer PRO_E)
        (Origin 0 0)
        (Rotation 0)
        (TextStyle "H50S3")
        (Justify Center)
        (Visible False)
        (Name "MINHEIGHT")
        (Data [String='CMHGT'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='L'+'MF'] [Number='T'])
        (EndPoint [Number='L'+'MF'] [Number='B'])
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Stripe"])
    )
    (Arc
        (Layer PRO_E)
        (Radius [Number={LineWidth}/2])
        (StartAngle 0)
        (SweepAngle 360)
        (Origin [Number='MX'] 0)
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Dot"])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='MX'-'MF'/2] 0)
        (EndPoint [Number='MX'+'MF'/2] 0)
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Plus"])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='MX'] [Number='MF'/2])
        (EndPoint [Number='MX'] [Number=0-'MF'/2])
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Plus"])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='L'] [Number='B'])
        (EndPoint [Number='R'] [Number='B'])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='R'] [Number='B'])
        (EndPoint [Number='R'] [Number='T'])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='R'] [Number='T'])
        (EndPoint [Number='L'] [Number='T'])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='L'] [Number='T'])
        (EndPoint [Number='L'] [Number='B'])
        (Width [Number='SW'])
    )
    (Arc
        (Layer PRO_E)
        (Radius [Number='MTW'/2])
        (StartAngle 180)
        (SweepAngle 180)
        (Origin [Number=0-'BW'/2+'MTW'/2] [Number=0-'BH2'/2+('MTW'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number=0-'BW'/2] [Number=0-('BH'/2)])
        (EndPoint [Number=0-'BW'/2] [Number=0-('BH2'/2)+('MTW'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number=0-'BW'/2+'MTW'] [Number=0-('BH2'/2)+('MTW'/2)])
        (EndPoint [Number=0-'BW'/2+'MTW'] [Number=0-('BH'/2)])
        (Width [Number='SW'])
    )
    (Arc
        (Layer PRO_E)
        (Radius [Number='MTW'/2])
        (StartAngle 0)
        (SweepAngle 180)
        (Origin [Number='BW'/2-'MTW'/2] [Number='BH2'/2-('MTW'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='BW'/2] [Number=('BH'/2)])
        (EndPoint [Number='BW'/2] [Number=('BH2'/2)-('MTW'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='BW'/2-'MTW'] [Number=('BH2'/2)-('MTW'/2)])
        (EndPoint [Number='BW'/2-'MTW'] [Number=('BH'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='L'] [Number='NEW_DRL1'/2])
        (EndPoint [Number=0-'LS'/2] [Number='NEW_DRL1'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number=0-'LS'/2] [Number='NEW_DRL1'/2])
        (EndPoint [Number=0-'LS'/2] [Number=0-'NEW_DRL1'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number=0-'LS'/2] [Number=0-'NEW_DRL1'/2])
        (EndPoint [Number='L'] [Number=0-'NEW_DRL1'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='R'] [Number='NEW_DRL'/2])
        (EndPoint [Number='LS'/2] [Number='NEW_DRL'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='LS'/2] [Number='NEW_DRL'/2])
        (EndPoint [Number='LS'/2] [Number=0-'NEW_DRL'/2])
        (Width [Number='SW'])
    )
    (Line
        (Layer PRO_E)
        (Origin [Number='LS'/2] [Number=0-'NEW_DRL'/2])
        (EndPoint [Number='R'] [Number=0-'NEW_DRL'/2])
        (Width [Number='SW'])
    )
    #Documentation and dimensions
    ## padstack names
    (Text
        (Layer DIMENSION)
        (Origin 0 [Number='EB'-320])
        (Justify UpperCenter)
        (Visible True)
        (Data [String="Default Pad Style: "+'PS2'])
    )
    (Text
        (Layer DIMENSION)
        (Origin 0 [Number='EB'-260])
        (Justify UpperCenter)
        (Visible True)
        (Data [String="Pin 1 Pad Style: "+'PS1'])
        (DoIf [String='PS1']<>[String='PS2'])
    )
    (Text
        (Layer DIMENSION)
        (Origin 0 [Number='EB'-380])
        (Justify UpperCenter)
        (Visible True)
        (Data [String="Alt 1 Pad Style: "+'A1_Pad'])
    )
    (Text
        (Layer DIMENSION)
        (Origin 0 [Number='EB'-440])
        (Justify UpperCenter)
        (Visible True)
        (Data [String="Alt 2 Pad Style: "+'A2_Pad'])
    )
    ## Dimensions
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Vertical)
        (Point1 [Number='R'] [Number='T'])
        (Point2 [Number='R'] [Number='B'])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number='LS'/2+100] [Number=0])
        (Text "BH")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify Left)
    )
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Vertical)
        (Point1 [Number='R'] [Number='BH2'/2])
        (Point2 [Number='L'] [Number=0-'BH2'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number='LS'/2+300] [Number=0])
        (Text "BH2")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify Left)
    )
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Vertical)
        (Point1 [Number=0-'MHS'/2] [Number=0-'MVS'/2])
        (Point2 [Number='MHS'/2] [Number='MVS'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0-('LS'/2+100)] [Number=0])
        (Text "MVS")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify Right)
    )
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Horizontal)
        (Point1 [Number=0-'LS'/2] [Number=0])
        (Point2 [Number='LS'/2] [Number=0])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0] [Number=0-('BH2'/2)-150])
        (Text "LS")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify UpperCenter)
    )
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Horizontal)
        (Point1 [Number=0-'MHS'/2] [Number=0-'MVS'/2])
        (Point2 [Number='MHS'/2] [Number='MVS'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0] [Number=0-('BH2'/2)-50])
        (Text "MHS")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify UpperCenter)
    )
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Horizontal)
        (Point1 [Number='R'] [Number='T'])
        (Point2 [Number='L'] [Number='T'])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0] [Number=('BH2'/2)+250])
        (Text "BW")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify LowerCenter)
    )
    (Dimension
        (Layer INPUTDIMENSIONS)
        (Orientation Horizontal)
        (Point1 [Number='R'] [Number='BH2'/2])
        (Point2 [Number='R'-'MTW'] [Number='BH2'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number='R'-('MTW'/2)] [Number=('BH2'/2)+50])
        (Text "MTW")
        (TextRotation 0)
        (TextStyle "H50S3")
        (TextJustify LowerCenter)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Vertical)
        (Point1 [Number='R'] [Number='T'])
        (Point2 [Number='R'] [Number='B'])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number='LS'/2+100] [Number=0])
        (Text [String="<PRETTYDIM="+'BH'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify Left)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Vertical)
        (Point1 [Number='R'] [Number='BH2'/2])
        (Point2 [Number='L'] [Number=0-'BH2'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number='LS'/2+300] [Number=0])
        (Text [String="<PRETTYDIM="+'BH2'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify Left)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Vertical)
        (Point1 [Number=0-'MHS'/2] [Number=0-'MVS'/2])
        (Point2 [Number='MHS'/2] [Number='MVS'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0-('LS'/2+100)] [Number=0])
        (Text [String="<PRETTYDIM="+'MVS'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify Right)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Horizontal)
        (Point1 [Number=0-'LS'/2] [Number=0])
        (Point2 [Number='LS'/2] [Number=0])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0] [Number=0-('BH2'/2)-150])
        (Text [String="<PRETTYDIM="+'LS'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify UpperCenter)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Horizontal)
        (Point1 [Number=0-'MHS'/2] [Number=0-'MVS'/2])
        (Point2 [Number='MHS'/2] [Number='MVS'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0] [Number=0-('BH2'/2)-50])
        (Text [String="<PRETTYDIM="+'MHS'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify UpperCenter)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Horizontal)
        (Point1 [Number='R'] [Number='T'])
        (Point2 [Number='L'] [Number='T'])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number=0] [Number=('BH2'/2)+250])
        (Text [String="<PRETTYDIM="+'BW'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify LowerCenter)
    )
    (Dimension
        (Layer DIMENSION)
        (Orientation Horizontal)
        (Point1 [Number='R'] [Number='BH2'/2])
        (Point2 [Number='R'-'MTW'] [Number='BH2'/2])
        (LineWidth [Number='DW'])
        (Visible True)
        (TextLocation [Number='R'-('MTW'/2)] [Number=('BH2'/2)+50])
        (Text [String="<PRETTYDIM="+'MTW'+">"])
        (TextRotation 0)
        (TextStyle "H25s3")
        (TextJustify LowerCenter)
    )
    ## Documentation Groups.
    (Group "GP_Attributes.adg"
        (Variable 'GP_REVLEVEL' [String='REVLEVEL'])
        (Variable 'GP_TRO' [Number='TRO'])
    )
    ## Footprint naming routine.
    (Script "GP_FootPrintName.vbs"
        (Variable 'NAME' [String='NAME'])
        (Variable 'PARTSTYLE' [String="RES2"])
        (Variable 'PINS' [String={PinCount}])
        (Variable 'BODYW' [String='BW'])
        (Variable 'BODYH' [String='BH'])
        (Variable 'CHGT' [String='CHGT'])
        (Variable 'COLS' [String='C'])
        (Variable 'ROWS' [String='R'])
        (Variable 'PITCH' [String='RP'])
        (Variable 'PITCH2' [String='CP'])
        (Variable 'BALLTYPE' [String=""])
        (Variable 'CLASS' [String="PWR"])
        (Variable 'SUFFIX' [String='SUFFIX'])
        (Variable 'TOE2TOE' [String=0])
        (Variable 'MF' [Number='MF'])
        (Variable 'JACKPOST' [Number='JACKPOST'])
        (Variable 'MOUNTHOLE' [Number='MOUNTHOLE'])
        (Variable 'RIBBON' [Number='RIBBON'])
        (Variable 'SHIELDED' [Number='SHIELDED'])
        (Variable 'SMT' [Number='SMT'])
        (Variable 'STOP' [Number='STOP'])
        (Variable 'POLARIZED' [Number=0])
        (Variable 'PRESSFIT' [Number='PRESSFIT'])
        (Variable 'RIGHTANGLE' [Number='RIGHTANGLE'])
        (Variable 'SHROUDED' [Number='SHROUDED'])
        (Variable 'STAGGERED' [Number='STAGGERED'])
        (Variable 'KEYED' [Number='KEYED'])
        (Variable 'UPRIGHT' [Number='UPRIGHT'])
        (Variable 'LATCHED' [Number='LATCHED'])
        (ReturnValue 'NNAME' 'NNAME')
    )
    ## Origin, Rotation, Glue Dot, Name attribute
    (Variable 'ORX1' [Number=0-'LS'/2])
    (Variable 'ORY1' [Number=0])
    ### Now compensate for the origin when rotating.
    (Variable 'ORX2' [Number='ORX1']
        (DoIf [Number='PROT']=[Number=0])
    )
    (Variable 'ORY2' [Number='ORY1']
        (DoIf [Number='PROT']=[Number=0])
    )
    (Variable 'ORX2' [Number=(0-('ORY1'))]
        (DoIf [Number='PROT']=[Number=90])
    )
    (Variable 'ORY2' [Number='ORX1']
        (DoIf [Number='PROT']=[Number=90])
    )
    (Variable 'ORX2' [Number=(0-('ORX1'))]
        (DoIf [Number='PROT']=[Number=180])
    )
    (Variable 'ORY2' [Number=(0-('ORY1'))]
        (DoIf [Number='PROT']=[Number=180])
    )
    (Variable 'ORY2' [Number=(0-('ORX1'))]
        (DoIf [Number='PROT']=[Number=270])
    )
    (Variable 'ORX2' [Number='ORY1']
        (DoIf [Number='PROT']=[Number=270])
    )
    (Origin [Number='ORX2'] [Number='ORY2'])
    (GlueDot 0 0)
    (PickPoint 0 0)
    (DefaultName [String='NNAME'])
    (Rotation [Number='PROT'])
    # Silkscreen and Assembly Data
    ## Pin One Marker
    ### New Diode pin 1 marker data
    (Group "GP_Diode.adg"
        (Variable 'GP_LP1' [Number=0-('LS'/2+'NEW_PADW'+10)])
        (Variable 'GP_WP1' [Number=0])
        (Variable 'GP_PROT' [Number=0])
        (DoIf [String='M']=[String="Diode"])
    )
    ## Body Lines and Groups
    (Arc
        (Layer TOP_ASSEMBLY)
        (Radius [Number='MTW'/2])
        (StartAngle 180)
        (SweepAngle 180)
        (Origin [Number=0-'BW'/2+'MTW'/2] [Number=0-'BH2'/2+('MTW'/2)])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number=0-'BW'/2] [Number=0-('BH'/2)])
        (EndPoint [Number=0-'BW'/2] [Number=0-('BH2'/2)+('MTW'/2)])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number=0-'BW'/2+'MTW'] [Number=0-('BH2'/2)+('MTW'/2)])
        (EndPoint [Number=0-'BW'/2+'MTW'] [Number=0-('BH'/2)])
        (Width [Number='AW'])
    )
    (Arc
        (Layer TOP_SILKSCREEN)
        (Radius [Number='MTW'/2+('SW'/2+2)])
        (StartAngle 180)
        (SweepAngle 180)
        (Origin [Number=0-'BW'/2+'MTW'/2] [Number=0-'BH2'/2+('MTW'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_SILKSCREEN)
        (Origin [Number=0-'BW'/2-('SW'/2+2)] [Number=0-('BH'/2)-('SW'/2+2)])
        (EndPoint [Number=0-'BW'/2-('SW'/2+2)] [Number=0-('BH2'/2)+('MTW'/2)+('SW'/2+2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_SILKSCREEN)
        (Origin [Number=0-'BW'/2+'MTW'+('SW'/2+2)] [Number=0-('BH2'/2)+('MTW'/2)+('SW'/2+2)])
        (EndPoint [Number=0-'BW'/2+'MTW'+('SW'/2+2)] [Number=0-('BH'/2)-('SW'/2+2)])
        (Width [Number='SW'])
    )
    (Arc
        (Layer TOP_ASSEMBLY)
        (Radius [Number='MTW'/2])
        (StartAngle 0)
        (SweepAngle 180)
        (Origin [Number='BW'/2-'MTW'/2] [Number='BH2'/2-('MTW'/2)])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='BW'/2] [Number=('BH'/2)])
        (EndPoint [Number='BW'/2] [Number=('BH2'/2)-('MTW'/2)])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='BW'/2-'MTW'] [Number=('BH2'/2)-('MTW'/2)])
        (EndPoint [Number='BW'/2-'MTW'] [Number=('BH'/2)])
        (Width [Number='AW'])
    )
    (Arc
        (Layer TOP_SILKSCREEN)
        (Radius [Number='MTW'/2+('SW'/2+2)])
        (StartAngle 0)
        (SweepAngle 180)
        (Origin [Number='BW'/2-'MTW'/2] [Number='BH2'/2-('MTW'/2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_SILKSCREEN)
        (Origin [Number='BW'/2+('SW'/2+2)] [Number=('BH'/2)+('SW'/2+2)])
        (EndPoint [Number='BW'/2+('SW'/2+2)] [Number=('BH2'/2)-('MTW'/2)-('SW'/2+2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_SILKSCREEN)
        (Origin [Number='BW'/2-'MTW'-('SW'/2+2)] [Number=('BH2'/2)-('MTW'/2)-('SW'/2+2)])
        (EndPoint [Number='BW'/2-'MTW'-('SW'/2+2)] [Number=('BH'/2)+('SW'/2+2)])
        (Width [Number='SW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='L'] [Number='NEW_DRL1'/2])
        (EndPoint [Number=0-'LS'/2] [Number='NEW_DRL1'/2])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number=0-'LS'/2] [Number='NEW_DRL1'/2])
        (EndPoint [Number=0-'LS'/2] [Number=0-'NEW_DRL1'/2])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number=0-'LS'/2] [Number=0-'NEW_DRL1'/2])
        (EndPoint [Number='L'] [Number=0-'NEW_DRL1'/2])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='R'] [Number='NEW_DRL'/2])
        (EndPoint [Number='LS'/2] [Number='NEW_DRL'/2])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='LS'/2] [Number='NEW_DRL'/2])
        (EndPoint [Number='LS'/2] [Number=0-'NEW_DRL'/2])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='LS'/2] [Number=0-'NEW_DRL'/2])
        (EndPoint [Number='R'] [Number=0-'NEW_DRL'/2])
        (Width [Number='AW'])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='MX'-'MF'/2] 0)
        (EndPoint [Number='MX'+'MF'/2] 0)
        (Width [Number='AW'])
        (DoIf [String='M']=[String="Plus"])
    )
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='MX'] [Number='MF'/2])
        (EndPoint [Number='MX'] [Number=0-'MF'/2])
        (Width [Number='AW'])
        (DoIf [String='M']=[String="Plus"])
    )
    (Line
        (Layer TOP_SILKSCREEN)
        (Origin [Number='MX'-'MF'/2] 0)
        (EndPoint [Number='MX'+'MF'/2] 0)
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Plus"])
    )
    (Line
        (Layer TOP_SILKSCREEN)
        (Origin [Number='MX'] [Number='MF'/2])
        (EndPoint [Number='MX'] [Number=0-'MF'/2])
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Plus"])
    )
    (Arc
        (Layer TOP_ASSEMBLY)
        (Radius [Number={LineWidth}/2])
        (StartAngle 0)
        (SweepAngle 360)
        (Origin [Number=0-'BW'/2+10] 0)
        (Width [Number='AW'])
        (DoIf [String='M']=[String="Dot"])
    )
    (Arc
        (Layer TOP_SILKSCREEN)
        (Radius [Number={LineWidth}/2])
        (StartAngle 0)
        (SweepAngle 360)
        (Origin [Number='MX'] 0)
        (Width [Number='SW'])
        (DoIf [String='M']=[String="Dot"])
    )
    #(Line
    #    (Layer TOP_SILKSCREEN)
    #    (Origin [Number='L'+'MF'] [Number='T'])
    #   (EndPoint [Number='L'+'MF'] [Number='B'])
    #    (Width [Number='SW'])
    #    (DoIf [String='M']=[String="Stripe"])
    #)
    (Line
        (Layer TOP_ASSEMBLY)
        (Origin [Number='L'+'MF'] [Number='T'])
        (EndPoint [Number='L'+'MF'] [Number='B'])
        (Width [Number='AW'])
        (DoIf [String='M']=[String="Stripe"])
    )
    (Group "GP_FourCornersGraphics.adg"
        (Variable 'GP_AW' [Number='AW'])
        (Variable 'GP_SW' [Number='SW'])
        (Variable 'GP_LLH' [Number='L'])
        (Variable 'GP_LLV' [Number='B'])
        (Variable 'GP_LRH' [Number='R'])
        (Variable 'GP_LRV' [Number='B'])
        (Variable 'GP_URH' [Number='R'])
        (Variable 'GP_URV' [Number='T'])
        (Variable 'GP_ULH' [Number='L'])
        (Variable 'GP_ULV' [Number='T'])
        (Variable 'GP_CHGT' [Number='CHGT'])
        (Variable 'GP_CMHGT' [Number='CMHGT'])
    )
)



