Hello!
Can you help me to find way to create linked objects in AutoCad from C#?
I mean - for example, circle and some lines lined to this circle:
- If I move line it should be possible to move only one end point of line - second endpoint should be linked to the circle and not moved.
- If I move circle it should be move all endpoints of all lines linked to this circle.
In general I want to create network diagramm ("graph" in mathematical terms) from C# code.
Is it possible? May be anybody has code exapmle?
Thanks again,
Pavel.
Hi Selevkos
Please check my answer before - I linked objects in ExtendedDictionary and allpy new position to all lined objects during move events.
Don't forget to handle copy/paste/delete for your objects it you want to store linked object list for copies objects for example.
Editor is easy - I have 2 promt dialogs - choose first object/point and choose linked object. And then I store this new link - I add new key/value in ExtendedDictionary as handle=linked_handle1, linked_handle2,... So I can easy parse it during any event.
Pavel.
Thanks for your fast reply.
I will try to do as you suggest.
But, also I want to create a network topology in which users will search for shortest or longest path between the nodes.
Do you have any suggestion for this?
Your task can be separated to 2 items: find path and show it.
If about second you can do it with OverruledDraw. Add special flag to ExtendedDictionary and it this flag is 1 - draw special line else standard. It allows you to draw path.
Second item has many ways. For example you can use additional library (for example C# libraries as GraphSharp or anythink else) or you can use graph theory for it.
Pavel.