<PAGE>   1

                                                                   EXHIBIT 10.17


              NINTH AMENDMENT TO FOURTH AMENDED AND RESTATED CREDIT
                              FACILITIES AGREEMENT

         THIS NINTH AMENDMENT TO FOURTH AMENDED AND RESTATED CREDIT FACILITIES
AGREEMENT (this "Amendment") is entered into as of July 1, 2001, by and among DT
INDUSTRIES, INC., a Delaware corporation ("Domestic Borrower"), DT INDUSTRIES
(UK) II LIMITED, ASSEMBLY TECHNOLOGIE & AUTOMATION GMBH, KALISH INC., formerly
Kalish Canada Inc., and DT CANADA INC. (together with Domestic Borrower,
separately and collectively, "Borrower"), BANK OF AMERICA, N.A., formerly
NationsBank, N.A., as administrative agent ("Administrative Agent"), and the
other lenders listed on the signature pages hereof (the "Lenders").

                                    RECITALS

                  (a) Borrower, Administrative Agent and the Lenders are parties
         to that certain Fourth Amended and Restated Credit Facilities Agreement
         dated as of July 21, 1997 (as amended through the date hereof, the
         "Credit Agreement"; terms defined in the Credit Agreement and not
         otherwise defined herein shall be used herein as defined in the Credit
         Agreement).

                  (b) Borrower has requested that the Lenders waive certain
         Events of Default, and the Lenders have agreed to waive such Events of
         Default, subject to the terms and conditions contained herein.

                  (c) Borrower, Administrative Agent, and the Lenders desire to
         amend the Credit Agreement to provide for, among other things, an
         extension of the final maturity date for the loans made thereunder, all
         subject to the terms and conditions contained herein.

         NOW, THEREFORE, in consideration of the covenants, conditions and
agreements hereafter set forth, and for other good and valuable consideration,
the receipt and adequacy of which are all hereby acknowledged, the parties
hereto covenant and agree as follows:

         1. WAIVER. Subject to the satisfaction of the conditions of
effectiveness set forth in Section 11 of this Amendment and the other conditions
contained herein, the Lenders hereby waive any Event of Default under Section
16.1. of the Credit Agreement which may have occurred as a result, directly or
indirectly, of (a) the failure of Borrower to comply with Sections 15.2., 15.3.,
15.5., and 15.6. or any of them for the fiscal quarter ending on or about March
31, 2001, (b) the failure of the Borrower to comply with financial covenants
under the Bond Documents for the fiscal quarter ending on or about March 31,
2001, and (c) any Event of Default arising from the Borrower's requests for
Advances of the Revolving Loan while any of the above Events of Default existed
(the "Existing Events of Default"). The waiver provided in this Section 1 shall
not be and shall not be deemed to be a waiver of any Defaults or Events of
Default under the Credit Agreement other than the Existing Events of Default.

         2. WAIVER TERMINATION. Notwithstanding anything in Section 1 above to
the contrary, if at any time Fleet National Bank, formerly BankBoston, N.A.
("Fleet") shall take any collection action


<PAGE>   2

under the Bond Documents, the waiver provided in Section 1 above shall be null
and void and of no further force or effect, and the Administrative Agent and the
Lenders may pursue any rights and remedies afforded to them under the Loan
Documents after the occurrence and during the continuance of an Event of
Default.

         3. AMENDMENTS TO THE CREDIT AGREEMENT. The Credit Agreement is hereby
amended as follows:

                  (a) Section 6.1.2. is entirely amended, as follows:

                  6.1.2. PRINCIPAL. Borrower shall repay the entire amount of
                  the Aggregate Revolving Loan as then outstanding on August 2,
                  2001. Canadian Borrowers shall repay the entire amount of the
                  Canadian Term Loan on August 2, 2001.

                  (b) The ninth sentence of Section 3.7. is entirely amended, as
                  follows:

                  The expiration date of any Letter of Credit will be a Business
                  Day that is not more than one year after its issuance date and
                  is not later than the date which is fifteen (15) days
                  following the Revolving Loan Maturity Date; provided, however,
                  that the expiration date for a Letter of Credit may be later
                  than such date if Letter of Credit Issuer and Required Lenders
                  consent to such issuance and Borrower provides to Letter of
                  Credit Issuer cash collateral satisfactory to Letter of Credit
                  Issuer and Required Lenders as security for Borrower's
                  obligation to reimburse Letter of Credit Issuer for all draws
                  thereunder.

         4. AMENDMENT FEE. Borrower shall pay to the Administrative Agent, for
the pro rata benefit of each Lender, an amendment fee (the "Amendment Fee"),
earned and due and payable as of the date of this Amendment, which fee shall be
equal to the product of (a) 0.25% multiplied by (b) an amount equal to the sum
of (i) such Lender's portion of the Commitment plus (ii) the aggregate amount of
the Canadian Term Loan owed to such Lender as of the date of this Amendment.

         5. ACKNOWLEDGMENT OF THE BORROWER. The Borrower acknowledges and agrees
that the Lenders executing this Amendment have done so in their sole discretion
and without any obligation. The Borrower further acknowledges and agrees that
any action taken or not taken by the Lenders or the Administrative Agent prior
to, on or after the date hereof shall not constitute a waiver or modification of
any term, covenant or provision of any Loan Document other than with respect to
the Existing Events of Default or prejudice any rights or remedies other than
with respect to the Existing Events of Default which the Administrative Agent or
any Lender now has or may have in the future under any Loan Document, Applicable
Law or otherwise, all of which rights and remedies are expressly reserved by the
Administrative Agent and the Lenders.

         6. SUBSIDIARIES ACKNOWLEDGMENT. By signing below, each of the Domestic
Borrower's Subsidiaries which has executed a guaranty of the Loan Obligations
(a) consents and agrees to this Amendment's execution and delivery, (b) ratifies
and confirms its obligations under its guaranty, (c) acknowledges and agrees
that its obligations under its guaranty are not released, diminished, impaired,


                                       2
<PAGE>   3

reduced, or otherwise adversely affected by this Amendment, and (d) acknowledges
and agrees that it has no claims or offsets against, or defenses or
counterclaims to, its guaranty.

         7. RELEASE.

                  (a) Upon this Amendment becoming effective, the Domestic
         Borrower and each of its Subsidiaries hereby unconditionally and
         irrevocably remises, acquits, and fully and forever releases and
         discharges the Administrative Agent and the Lenders and all respective
         affiliates and subsidiaries of the Administrative Agent and the
         Lenders, their respective officers, servants, employees, agents,
         attorneys, principals, directors and shareholders, and their respective
         heirs, legal representatives, successors and assigns (collectively, the
         "Released Lender Parties") from any and all claims, demands, causes of
         action, obligations, remedies, suits, damages and liabilities
         (collectively, the "Borrower Claims") of any nature whatsoever, whether
         now known, suspected or claimed, whether arising under common law, in
         equity or under statute, which the Domestic Borrower or any of its
         Subsidiaries ever had or now has against the Released Lender Parties
         which may have arisen at any time on or prior to the date of this
         Amendment and which were in any manner related to any of the Loan
         Documents or the enforcement or attempted enforcement by the
         Administrative Agent or the Lenders of rights, remedies or recourses
         related thereto.

                  (b) Upon this Amendment becoming effective, the Domestic
         Borrower and each of its Subsidiaries covenants and agrees never to
         commence, voluntarily aid in any way, prosecute or cause to be
         commenced or prosecuted against any of the Released Lender Parties any
         action or other proceeding based upon any of the Borrower Claims which
         may have arisen at any time on or prior to the date of this Amendment
         and were in any manner related to any of the Loan Documents.

                  (c) The agreements of the Domestic Borrower and each of its
         Subsidiaries set forth in this Section 9 shall survive termination of
         this Amendment and the other Loan Documents.

         8. REPRESENTATIONS AND WARRANTIES. By its execution and delivery
hereof, the Borrower represents and warrants to the Lenders that, as of the date
hereof:

                  (a) after giving effect to the waiver set forth in Section 1
         of this Amendment, the representations and warranties contained in the
         Credit Agreement and the other Loan Documents are true and correct on
         and as of the date hereof as if made on and as of such date; and

                  (b) after giving effect to the waiver set forth in Section 1
         of this Amendment, no event has occurred and is continuing which
         constitutes a Default or an Event of Default.

         9. CONDITIONS OF EFFECTIVENESS. This Amendment shall be effective as of
July 1, 2001, so long as all corporate actions of Borrower and the Significant
Subsidiaries taken in connection herewith and the transactions contemplated
hereby shall be satisfactory in form and substance



                                       3
<PAGE>   4

to Administrative Agent and Lenders, and each of the following conditions
precedent shall have been satisfied:

                  (a) All reasonable out-of-pocket fees and expenses in
         connection with the Loan Documents, including this Amendment, including
         legal and other professional fees and expenses incurred on or prior to
         the date of this Amendment by Administrative Agent or any Lender,
         including, without limitation, the fees and expenses of Winstead
         Sechrest & Minick P.C. and Arthur Andersen L.L.P., shall have been
         paid.

                  (b) Administrative Agent and each Lender shall have received
         each of the following:

                           (i) a certificate of the Borrower, in form and
                  substance satisfactory to Administrative Agent, Required
                  Lenders and Administrative Agent's counsel, certifying (A) as
                  to the accuracy in all material respects, after giving effect
                  to this Amendment and the waiver in Section 1 hereof, of the
                  representations and warranties set forth in the Credit
                  Agreement, this Amendment and the other Loan Documents, and
                  (B) that there exists no Default or Event of Default, after
                  giving effect to this Amendment and the waiver in Section 1
                  hereof, and the execution, delivery and performance of this
                  Amendment will not cause a Default or Event of Default;

                           (ii) payment of the Amendment Fee; and

                           (iii) such other documents, certificates and
                  instruments as the Administrative Agent shall require prior to
                  the date hereof.

         10. REFERENCE TO CREDIT AGREEMENT. Upon the effectiveness of this
Amendment, each reference in the Credit Agreement to "this Agreement,"
"hereunder," or words of like import shall mean and be a reference to the Credit
Agreement, as affected and amended by this Amendment.

         11. COUNTERPARTS; EXECUTION VIA FACSIMILE. This Amendment may be
executed in one or more counterparts, each of which shall be deemed an original,
but all of which together shall constitute one and the same instrument. This
Amendment may be validly executed and delivered by facsimile or other electronic
transmission.

         12. GOVERNING LAW: BINDING EFFECT. This Amendment shall be governed by
and construed in accordance with the laws of the State of Texas and shall be
binding upon the Borrower, the Administrative Agent, each Lender and their
respective successors and assigns.

         13. HEADINGS. Section headings in this Amendment are included herein
for convenience of reference only and shall not constitute a part of this
Amendment for any other purpose.




                                       4
<PAGE>   5

         14. LOAN DOCUMENT. This Amendment is a Loan Document and is subject to
all provisions of the Credit Agreement applicable to Loan Documents, all of
which are incorporated in this Amendment by reference the same as if set forth
in this Amendment verbatim.

         15. NO ORAL AGREEMENTS. THIS WRITTEN AGREEMENT AND THE OTHER LOAN
DOCUMENTS REPRESENT THE FINAL AGREEMENT BETWEEN THE PARTIES AND MAY NOT BE
CONTRADICTED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS, OR SUBSEQUENT ORAL
AGREEMENTS OF THE PARTIES. THERE ARE NO UNWRITTEN ORAL AGREEMENTS BETWEEN THE
PARTIES.

                  [REMAINDER OF PAGE INTENTIONALLY LEFT BLANK]




                                       5
<PAGE>   6

         IN WITNESS WHEREOF, the parties hereto have executed this Amendment as
the date first above written.


DT INDUSTRIES, INC.,                    KALISH INC. formerly Kalish Canada Inc.,
a Delaware corporation                  a New Brunswick, Canada corporation



By:    /s/ John M. Casper               By:    /s/ John M. Casper
   ---------------------------------       -------------------------------------
Name:  John M. Casper                   Name:  John M. Casper
     -------------------------------         -----------------------------------
Title: Senior Vice President-           Title: Vice President
       Finance, CFO                            ---------------------------------
       -----------------------------


DT CANADA INC.,                         ASSEMBLY TECHNOLOGIE & AUTOMATION GMBH,
a New Brunswick, Canada corporation     a German limited liability company




By:    /s/ John M. Casper               By:    /s/ John M. Casper
   ---------------------------------       -------------------------------------
Name:  John M. Casper                   Name:  John M. Casper
     -------------------------------         -----------------------------------
Title: Vice President                   Title: Geschaftsfuhrer
       -----------------------------           ---------------------------------


DT INDUSTRIES (UK) II LIMITED,
a corporation of England and Wales



By:    /s/ John M. Casper
   ---------------------------------
Name:  John M. Casper
     -------------------------------
Title: Managing Director
      ------------------------------





<PAGE>   7


BANK OF AMERICA, N.A., formerly               DRESDNER BANK AG, NEW YORK
NationsBank, N.A., as Administrative Agent    AND GRAND CAYMAN BRANCHES
and a Lender



By: /s/ William E. Livingstone, IV            By:    /s/ Richard J. Sweeney
    --------------------------------------       -------------------------------
    William E. Livingstone, IV                Name:  Richard J. Sweeney
    Managing Director                              -----------------------------
                                              Title: Vice President
                                                     ---------------------------


                                              By:    /s/ James M. Gallagher
                                                 -------------------------------
                                              Name:  James M. Gallagher
                                                   -----------------------------
                                              Title: First Vice President
                                                     ---------------------------


MERRILL LYNCH, PIERCE,                        THE BANK OF NOVA SCOTIA
FENNER & SMITH, INCORPORATED



By:    /s/ Barbara S. Scholl                  By:    /s/ M. D. Smith
    --------------------------------------       -------------------------------
Name:  Barbara S. Scholl                      Name:  M. D. Smith
     -------------------------------------         -----------------------------
Title: Managing Director                      Title: Agent
      ------------------------------------          ----------------------------


SUMITOMO MITSUI BANKING CORPORATION           FIRSTAR BANK, N.A.



By:    /s/ Tamihiro Kawauchi                  By:    /s/ Timothy N. Sheer
    --------------------------------------       -------------------------------
Name:  Tamihiro Kawauchi                      Name:  Timothy N. Sheer
     -------------------------------------         -----------------------------
Title: Joint General Manager                  Title: Vice President
      ------------------------------------          ----------------------------


GENERAL ELECTRIC CAPITAL CORPORATION



By:    /s/ Janet K. Williams
    --------------------------------------
Name:  Janet K. Williams
     -------------------------------------
Title: Duly Authorized Signatory
      ------------------------------------


NATIONAL CITY BANK



By:    /s/ Sharon L. Johnston
    --------------------------------------
Name:  Sharon L. Johnston
     -------------------------------------
Title: Vice President
      ------------------------------------





<PAGE>   8


ACKNOWLEDGED AND AGREED:

ADVANCED ASSEMBLY AUTOMATION, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------

ASSEMBLY TECHNOLOGY & TEST, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------

DETROIT TOOL AND ENGINEERING COMPANY



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------



DETROIT TOOL METAL PRODUCTS CO.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------

HANSFORD MANUFACTURING CORPORATION



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------

PHARMA GROUP, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------



<PAGE>   9

MID-WEST AUTOMATION ENTERPRISES, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------

MID-WEST AUTOMATION SYSTEMS, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------

SENCORP SYSTEMS, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------



VANGUARD TECHNICAL SOLUTIONS, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------



ARMAC INDUSTRIES CO.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------



ASSEMBLY MACHINES, INC.



By:    /s/ John M. Casper
   ------------------------------------
Name:  John M. Casper
     ----------------------------------
Title: Vice President
      ---------------------------------