Methods


SplitIntoParts


This example illustrates how to use the SplitIntoParts method, which processes a collection of DXF entities and generates a list of new DXF documents. Each document contains individual components of the specified entities, neatly enclosed within closed sections.

This method is particularly valuable for isolating distinct elements from a complex DXF file, enabling separate manipulation, analysis, or further processing of each part with precision and efficiency.

Overview

The DXFSplitIntoParts application is a Windows Forms application designed to work with DXF files using the DXFReaderNET library. It allows users to load, view, split, and save DXF files. The application also provides functionalities to manage user settings and preferences through the Windows Registry.

Features

·Load and view DXF files.

·Create new DXF drawings.

·Split DXF files into parts.

·Save individual parts of a DXF file.

·Display drawing information.

·Manage user settings and preferences.

User Interface

The main form (Form1) contains the following key components:

·Menu Strip: Provides options to create new drawings, load and save DXF files, split drawings into parts, and view drawing information.

·Tab Control: Displays the loaded DXF file and its parts in separate tabs.

·Status Strip: Shows status messages and drawing information.

Menu Options

File

·New Drawing: Creates a new DXF drawing.

·Load DXF File: Opens a dialog to load a DXF file.

·Save DXF File: Opens a dialog to save the current DXF file.

·Save All Parts: Opens a dialog to save all parts of the split DXF file.

·Exit: Exits the application.

Tools

·Split Into Parts: Splits the loaded DXF file into individual parts and displays them in separate tabs.

·Drawing Info: Displays information about the current drawing.

Help

·About DXFReader.NET Component: Displays information about the DXFReaderNET component.

Usage Instructions

Creating a New Drawing

1.Click on File > New Drawing.

2.A new drawing will be created and displayed in the first tab.

Loading a DXF File

1.Click on File > Load DXF File.

2.Select a DXF file from the file dialog and click Open.

3.The selected DXF file will be loaded and displayed in the first tab.

Saving a DXF File

1.Click on File > Save DXF File.

2.Select a location and enter a file name in the save file dialog.

3.Click Save to save the current DXF file.

Splitting a DXF File into Parts

1.Load a DXF file as described above.

2.Click on Tools > Split Into Parts.

3.The DXF file will be split into individual parts, each displayed in a separate tab.

Saving All Parts of a DXF File

1.Split the DXF file into parts as described above.

2.Click on File > Save All Parts.

3.Select a folder in the folder browser dialog and click OK.

4.All parts will be saved in the selected folder.

Viewing Drawing Information

1.Click on Tools > Drawing Info.

2.Information about the current drawing will be displayed.

Settings and Preferences

The application saves user settings and preferences in the Windows Registry. These settings include window size and position, DXF control properties, and file paths. The settings are loaded when the application starts and saved when the application exits or the form is closed.


Download C# code from GitHub

 


Warning!
All samples, data, places and images in this section are only for tutorial scope. They are fictitious and may not correspond to real cases.

Any similarities to actual persons or places is merely coincidental.

To evaluate all code samples you need to download and install the DXFReader.NET Compoonent first.