示例#1
0
        /// <summary>
        ///     Constructor that requires a path to a file.
        ///     This constructor will read the file and set up all of the required
        ///     tools for the DxfFile class
        /// </summary>
        /// <param name="pathToFile">An absolute or relative path to a dxf file</param>
        public DxfFile(string pathToFile)
        {
            // Initialize
            var fileReader = new DxfReader(pathToFile);

            Layers = new LayerDictionary();

            // Setup file
            PathToFile  = fileReader.PathToFile;
            FileName    = Path.GetFileName(PathToFile);
            DxfFileData = new TaggedDataList(fileReader.ReadFile());

            // The Main Parsing Calling Function
            var asciiParser = new AsciiParser(this);

            asciiParser.ParseFile();

            // Update the layer dictionary now that the Entities are all built
            Layers.UpdateDictionary(Entities.Values);
        }