======================================================================================================

 Program created by Suresh Amberkar, Technisites Australia Pty Ltd.
      www.technisites.com.au

  Program Name: 2DMetricFasteners.cs

  Version: 1.0

  Date: 20th July 2016

  THIS CODE COMES WITH ABSOLUTELY NO WARRANTY AND IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 
  A PARTICULAR PURPOSE.  THE AUTHOR DOES NOT GUARANTEE THAT THE INFORMATION CONTAINED IN ASSOCIATED
  FASTENER DATA FILES ARE ACCURATE NOR THE RESULTS PRODUCED BY IT ARE ACCURATE OR VERIFIED.

======================================================================================================

 Program for creating 2D fasteners in NX.  Tested on NX 8, NX 9 & NX 10.
 Creates 2D Top View and Section View of
  - Metric Socket Head Cap Screws
  - Metric Socket Head Countersunk Screws
  - Metric Socket Head Shoulder Screws

 Standard Screw Size data is stored in the following files
  - MetricCapScrewSizeData.csv
  - MetricCountersunkScrewSizeData.csv
  - MetricShoulderScrewSizeData.csv

 Standard Screw Lengths data is stored in the following files
  - MetricCapScrewLengths.csv
  - MetricCountersunkScrewLengths.csv
  - MetricShoulderScrewLengths.csv

 The 'Screw Size' list in the program is populated by reading the appropriate
  Standard Screw Size data file.

 Appropriate screw length is selected by measuring the distance between the
  - Base Line (the line from where the hole is tapped)
  - Boundary Line (the line from where the screw is inserted)
  plus the thread engagement length, minus the counter bore depth. Counter bore depth
  is adjusted to accommodate standard screw length.

 Shoulder screws are drawn with a clearnace on body diameter and 2mm clearnace under
  the head.

 Top view is always drawn in the XC YC plane.
 
 Section view requires three lines to be picked.
  - The screw center line
  - The base line (where the tap hole begins)
  - The boundary line (where the screw is inserted from)
  - The base line and boundary line are expected to be parallel to each other and 
  perpendicular to the center line. All three lines must be on the same plane.
  They can be in any orientation as long as the above conditions are met.

 Program expects the associated screw data csv files and bitmap files for the dialog to be
  in a directory called '2dMetricFasteners'.  This directory should be placed under
  directory pointed to by 'UGII_SITE_DIR' environment variable.

======================================================================================================
