I need some guidance with a C# app I am writing to make my life at work easier. I figured this is a good opportunity to learn OOP as well.
I want to extract entities from a dxf file, such as lines, points, circles and arcs. It is an ASCII version that can be read with a text editor. Here is an example, how are entities stored:
From here I would extract the position of an entity. My question is, how can I store entities as objects?
Lets say I make a class called Line, which can hold data about coordinates and has some relevant methods. How can I instantiate objects during runtime since I do not know how many line entities are there until I evaluate a file. In other words, I would like to create instances during runtime called Line1, Line2 etc.
Additionally, how can I check how many instances of a class have been created? Should I make a static class variable to count instances which is then incremented in the constructor?
I'd appreciate any suggestions or links to some tutorials. Thanks.