Exhibit 4.1



 Exhibit 4.1 
 FIRST AMENDMENT TO CREDIT AGREEMENT 
 THIS FIRST AMENDMENT TO CREDIT
AGREEMENT (this “Amendment”) is dated as of October 28, 2011, among TREX COMPANY, INC., a Delaware corporation (the “Borrower”); the lenders party hereto (each, a “Lender” and, collectively,
the “Lenders”); and BRANCH BANKING AND TRUST COMPANY, as Administrative Agent and Letter of Credit Issuer. 

The Borrower, the Lenders, the Administrative Agent, the Letter of Credit Issuer and BB&T Capital Markets, as Lead Arranger, are
parties to a Credit Agreement dated as of November 4, 2009 (the “Credit Agreement”), and they now desire to amend certain provisions of the Credit Agreement as provided herein. 

Contemporaneously herewith, put prior hereto, TD Bank, N.A. has assigned all of its Revolver Commitment, Reducing Revolver Commitment,
Revolver Advances and Reducing Revolver Advances to Brach Banking and Trust Company. 
 Accordingly, for and in consideration of
the premises and other good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the Borrower, the Lenders, the Letter of Credit Issuer and the Administrative Agent hereby agree as follows: 

1. Capitalized Terms; Effective Date. Capitalized terms used in this Amendment which are not otherwise defined herein shall have
the meanings assigned thereto in the Credit Agreement, as amended by this Amendment. Except as expressly provided to the contrary herein, all amendments to the Credit Agreement set forth herein shall be effective as of the date of this Amendment.

 2. Credit Agreement Amendments. The following provisions of the Credit Agreement are amended as follows: 

2.1. Existing Definitions. The definitions of “Deeds of Trust” and “Stated Termination Date” set forth in
Section 1.01 of the Credit Agreement is amended and restated in its entirety to read as follows: 

“Deeds of Trust” means, collectively, the Olive Branch Deed of Trust, the Winchester Deed of Trust and the
Nevada Deed of Trust (once executed and delivered to the Collateral Agent and recorded in the applicable real estate records). 
 “Stated Termination Date” means December 31, 2012. 
 2.2. New
Definitions. New definitions of “Controlled Account”, “Eligible Equipment and Machinery”, “Eligible Real Estate” and “Nevada Deed of Trust” are added to Section 1.01 of the Credit Agreement to read as
follows: 
 “Controlled Account” means the separate deposit account of the Borrower established with
BB&T and maintained in accordance with Section 5.37 hereof, over which the Administrative Agent shall have sole control. 
 “Eligible Equipment and Machinery” means any equipment and machinery owned by the Borrower (i) that is held for use in the ordinary course of the Borrower’s business, (ii) which
is physically located in the continental United States on premises owned by the Borrower (or, if such premises are owned by a third Person, such Person has waived or subordinated any lien it may have in a form satisfactory to the Administrative
Agent and its counsel), (iii) which is not subject to any assignment, security interest, lien, claim, or encumbrance of any kind other than the lien and security interest of the Collateral Agent, and (iv) which is not otherwise
unacceptable to the Administrative Agent, in its reasonable discretion. 
 “Eligible Real Estate”
means, collectively, (i) the Nevada Property so long as the Nevada Deed of Trust is effective, (ii) the Olive Branch Property so long as the Olive Branch Deed of Trust is effective, and (iii) the Winchester Property so long as the
Winchester Deed of Trust is effective. 

  
 1 








 “Nevada Deed of Trust” means a Deed of Trust, in form and
substance reasonably satisfactory to the Collateral Agent, from the Borrower to the trustee named therein for the benefit of the Collateral Agent (on behalf of the Secured Parties), covering the Nevada Property, as it may be amended, restated,
supplemented or otherwise modified from time to time. 
 2.3. Termination or Reduction of Commitments.
Section 2.08(b) to the Credit Agreement is amended and restated in its entirety to read as follows: 
 (b)
[Intentionally Deleted]. 
 2.4. Termination or Reduction of Commitments. Section 2.11(b) to the Credit Agreement is
amended and restated in its entirety to read as follows: 
 (b) [Intentionally Deleted]. 

2.5. Mandatory Prepayments. A new Section 2.11(h) is added to the Credit Agreement to read as follows: 

(h) The Borrower shall repay or prepay each outstanding Borrowing, and shall repay or otherwise reduce the Letter of
Credit Obligations, such that the outstanding principal amount of all Advances and the outstanding Letter of Credit Obligations shall be $0 on April 30, 2012; provided, however, that Letters of Credit in an aggregate stated amount not to exceed
$5,000,000 may remain issued and outstanding on and after April 30, 2012, so long as such Letters of Credit are cash-collateralized in a manner satisfactory to the Letter of Credit Issuer. On and after April 30, 2012, unless and until all
outstanding Senior Subordinated Notes have been redeemed in full, no additional Borrowings shall be made (and no additional Letters of Credit shall be issued, except for Letters of Credit in an aggregate stated amount not to exceed $5,000,000 that
are cash-collateralized in a manner satisfactory to the Letter of Credit Issuer) hereunder, other than any Borrowing, the proceeds of which are used to redeem all or any portion of the outstanding Senior Subordinated Notes. 

2.6. Controlled Account. A new Section 5.37 is added to the Credit Agreement to read as follows: 

SECTION 5.37. Controlled Account. 

The Borrower shall maintain on deposit in the Controlled Account (i) from October 28, 2011, through May 31,
2012, an amount not less than $37,000,000, and (ii) from June 1, 2012, and thereafter, until the Senior Subordinated Notes have been redeemed in full, an amount not less than 50% of the outstanding principal balance of the Senior
Subordinated Notes as of June 1, 2012. 
 2.7. Minimum Borrowing Base. A new Section 5.38 is added to the
Credit Agreement to read as follows: 
 SECTION 5.38. Minimum Borrowing Base. 

The Borrower shall cause the sum of (a) the Borrowing Base, plus (b) the amount on deposit in the Controlled
Account in excess of the amount required to be on deposit therein pursuant to Section 5.37 hereof, plus (c) an amount equal to 80% of the orderly liquidation value of Eligible Equipment and Machinery, plus (d) an amount equal to 75%
of the “as-is” appraised value of Eligible Real Estate, to be not less than $75,000,000 from January 1, 2012, until the date on which all outstanding Senior Subordinated Notes have been redeemed in full. 

2.8. Commitments. BB&T’s revised Revolver Commitment and Reducing Revolver Commitment shall be as set forth on its
signature page hereto. 
 3. Representations. The Borrower hereby represents and warrants to the Administrative Agent and
the Lenders that: 
 3.1. The Borrower is in compliance with all of the terms, covenants and conditions of the Credit Agreement,
as amended by this Amendment, and all of the terms, covenants and conditions of each of the other Loan Documents. 

  
 2 








 3.2. There exists no Default or Event of Default. 

3.3. The representations and warranties contained in Article IV of the Credit Agreement are, except to the extent that they relate
solely to an earlier date, true with the same effect as though such representations and warranties had been made on the date hereof. 
 3.4. The Borrower has full corporate or other organizational power and authority to execute, deliver and perform its obligations under this Amendment and the Replacement Notes (as hereinafter defined) and
to incur the obligations provided for herein and therein, all of which have been duly authorized by all proper and necessary corporate action. No consent or approval of the stockholders of the Borrower which has not been obtained and no consent or
approval of, notice to or filing with, any public authority which has not been obtained or made is required as a condition to the validity of this Amendment or the Replacement Notes. 

3.5. This Amendment and the Replacement Notes constitute the valid and legally binding obligations of the Borrower, enforceable in
accordance with their respective terms, except as the enforceability hereof or thereof may be limited by bankruptcy, insolvency, or similar laws affecting creditors’ rights generally or by general principles of equity (regardless of whether
such enforceability is considered in a proceeding at law or in equity). 
 3.6. There are no actions, suits, proceedings or
investigations pending or, so far as the officers of the Borrower know, threatened before any court or administrative agency that, in the opinion of the officers of the Borrower, will materially adversely affect (i) the financial condition or
operations of the Borrower, or (ii) the ability of the Borrower to execute or deliver this Amendment or the Replacement Notes, or to carry out the terms of the Credit Agreement, as amended by this Amendment, or the Replacement Notes.

 3.7. There is no charter, by-law, or other organizational document provision of the Borrower and no provision of any existing
mortgage, lease, indenture, contract, or agreement binding on the Borrower or affecting its property that would conflict with or in any way prevent the execution or delivery of this Amendment or the Replacement Notes, or the carrying out of the
terms of the Credit Agreement, as amended by this Amendment, or the Replacement Notes. 
 4. No Other Amendments;
Reaffirmation; Waiver and Release; No Novation. Except as expressly amended hereby, the terms of the Credit Agreement shall remain in full force and effect in all respects, and the Borrower hereby reaffirms its obligations under the Credit
Agreement, as amended by this Amendment, and under each of the other Loan Documents. The Borrower, for itself and for its successors and assigns, hereby waives and releases the Administrative Agent, the Lenders and their respective successors and
assigns, from any claim, cause of action, defense, counterclaim, set-off or recoupment of any kind or nature known to the Borrower that it may now or hereafter assert against the Administrative Agent or any Lender arising from or in connection with
the Credit Agreement, as amended by this Amendment, or the transactions contemplated thereby or hereby that exist on the date hereof or arise from facts or actions occurring prior hereto or on the date hereof. For purposes of the preceding sentence,
the terms “Agent” and “Lender” shall include the Administrative Agent’s and each Lender’s former, present and future officers, directors, employees, agents and attorneys. Nothing contained in this Amendment shall be
construed to constitute a novation with respect to the indebtedness described in the Credit Agreement. 
 5. Conditions.
The effectiveness of this Amendment is subject to the following conditions precedent: 
 5.1. Amendment. The Borrower and
the Lenders shall have executed and delivered to the Administrative Agent a counterpart of this Amendment. 
 5.2.
Replacement Notes. The Borrower shall have executed and delivered to BB&T a replacement Revolver Note and a replacement Reducing Revolver Note (together, the “Replacement Notes”), each in form and substance satisfactory
to the Bank and reflecting BB&T’s revised Revolver Commitment and Reducing Revolver Commitment, respectively. 
 5.3.
Controlled Account. The Borrower shall have established the Controlled Account with BB&T and shall have deposited therein an amount not less than $37,000,000. 

  
 3 








 5.4. Amendment Fee. The Borrower shall have paid to the Administrative Agent on
behalf of the Lenders an amendment fee in the amount of $55,000, which amendment fee shall be fully-earned and non-refundable once paid. 
 6. Lien on Nevada Property. On or prior to December 31, 2011: 
 (a)
the Nevada Deed of Trust shall have been duly executed by the Borrower and recorded in the applicable real estate records in order to create in favor of the Collateral Agent for the benefit of the Secured Parties, a valid, legal and perfected
first-priority lien on the Nevada Property; 
 (b) the Administrative Agent shall have received a current survey of the Nevada
Property satisfactory to the Administrative Agent, showing no encroachments that are not satisfactory to the Administrative Agent and prepared by a certified land surveyor (using certification language satisfactory to the Administrative Agent),
which survey shall designate, without limitation, (i) the dimensions of the Nevada Property, (ii) the dimensions and location of the buildings and other improvements constructed thereon, (iii) the dimensions of the parking spaces as
well as the total number of parking spaces, (iv) the location of all easements of record affecting the Nevada Property, specifying the holder of such easement and the pertinent recording information, (v) any and all building restrictions
and/or setback lines, (vi) means of ingress and egress, and (vii) any portion of the Nevada Property that is located in a special flood hazard area; 
 (c) the Administrative Agent shall have received a policy of mortgagee title insurance insuring the lien of the Nevada Deed of Trust as a first priority deed of trust lien on the Nevada Property, in an
amount acceptable to the Administrative Agent, issued by a title insurance company acceptable to the Administrative Agent, without exception for possible filed or unfiled mechanics’ and materialmen’s liens, containing only such exceptions
as are acceptable to the Administrative Agent, and containing such endorsements and affirmative coverage as are requested by the Administrative Agent, and copies of all instruments that appear as exceptions to title on such policy; and 

(d) the Administrative Agent shall have received a report from a qualified environmental engineer or consultant acceptable to the
Administrative Agent with respect to an environmental investigation and audit of the Nevada Property (the scope of which shall be defined by the Administrative Agent), showing no contamination by Hazardous Materials, no violation of any
Environmental Law, and that no portion of the Nevada Property constitutes “wetlands” under any Environmental Law, except as approved by the Administrative Agent. 
 7. Security for Obligations. The Borrower acknowledges and agrees that all indebtedness and other obligations of the Borrower under the Credit Agreement, as amended by this Amendment, and the other
Loan Documents, including without limitation the indebtedness evidenced by the Replacement Notes, are secured by the Collateral described in the Collateral Documents. 
 8. References. All references in the Credit Agreement to “this Agreement,” “herein,” “hereunder” or other words of similar import, and all references to the
“Credit Agreement” or similar words in the other Loan Documents, or any other document or instrument that refers to the Credit Agreement, shall be deemed to be references to the Credit Agreement as amended by this Amendment. 

9. Expenses. The Borrower agrees to pay all reasonable out-of-pocket expenses incurred by the Administrative Agent and the Lenders
in connection with the preparation of this Amendment and the consummation of the transactions described herein, including, without limitation, the reasonable attorneys’ fees and expenses of the Administrative Agent and the Lenders. 

10. Applicable Law. This Amendment and the Replacement Notes shall be construed in accordance with and governed by the laws of the
Commonwealth of Virginia. 
 11. Counterparts. This Amendment may be executed in any number of counterparts, each of
which shall be an original, but all of which taken together shall constitute one and the same instrument. 
 12.
Successors. This Amendment shall be binding upon and inure to the benefit of the parties hereto and their respective successors and assigns. 
 13. Entire Agreement. This Amendment represents the final agreement of the Borrower, the Lenders and the Administrative Agent with respect to the subject matter hereof, and may not be contradicted,
modified or supplemented in any way by evidence of any prior or contemporaneous written or oral agreements of the Borrower, the Lenders and/or the Administrative Agent. 

  
 4 








 IN WITNESS WHEREOF, the Borrower, the Lenders, the Letter of Credit Issuer and the
Administrative Agent have caused this Amendment to be executed by their duly authorized officers, under seal, all as of the date first written above. 

 

					
	TREX COMPANY, INC.,	 	(SEAL)
	  a Delaware corporation	 	
		
	By:	 	 /s/ James E. Cline

	Name:	 	James E. Cline
	Title:	 	Vice President and Chief Financial Officer
	
	BRANCH BANKING AND TRUST COMPANY,
	  as Administrative Agent, Letter of Credit Issuer
	  and as a Lender	 	(SEAL)
		
	By:	 	 /s/ Matthew W. Rush

	Name:	 	Matthew W. Rush
	Title:	 	Senior Vice President


  

					
	 Revolver Commitment:
	 	 	$40,000,000	  
	 Reducing Revolver Commitment:
	 	 	$15,000,000	  


  
 5