condition :
1. All objects are straight lines with 3D points.
2. When they intersect, the end points meet. = Intersections that do not meet endpoints are not valid.
The steps I've been thinking :
1. get dxf numbers 10 and 11 to create a point list in a row. this is main point list
2. If both endpoints of a line are unique in the point list, they are created into separate groups and delete from the main point list.
3. Start grouping based on one reference line.
4. Find other lines that share the same endpoint as this reference line,
Two points of the original line are removed from the main point list.
opposite point of the collected lines is used as the next net.
5. counts each time captures a line, and when no more can be collected, group with entity names are extracted by forming them into a list within a list.
and go back to step 3. starts collecting the next group.
6. It ends when the number of members in the main point list becomes 0, and different colors are assigned to each group.
If there is a better way, please let me know.