This project has moved. For the latest updates, please go here.

"Group" more separated polylines so that all are highlighted when one of them is

Jul 6, 2015 at 9:07 PM
I have multiple polylines (to be more precise multiple list of vertexes and from eachlist I create polyline) which are separated from each other. I was wondering is it possible to group them somehow? Basically I want that when user click on one of polylines, that all polylines from that group become highlighted so that any operation is on all polylines from group and not just one which is highlighted.
Is there some appropriate entity for that? Something like multipolyline? Or multipolygon? On can I somehow "group" existing polylines?
Coordinator
Jul 7, 2015 at 6:27 PM
Edited Jul 7, 2015 at 7:33 PM
The most approximate thing in the dxf implementation is the Group object, that represents a group of entities. It not only holds polylines but any kind of entities. Something like:
List<LwPolylineVertex> vertexes1 = new List<LwPolylineVertex>(new[] { new LwPolylineVertex(0, 0), new LwPolylineVertex(5, 5), new LwPolylineVertex(10, 0) });
LwPolyline p1 = new LwPolyline(vertexes1);

List<LwPolylineVertex> vertexes2 = new List<LwPolylineVertex>(new[] { new LwPolylineVertex(0, -5), new LwPolylineVertex(5, 0), new LwPolylineVertex(10, -5) });
LwPolyline p2 = new LwPolyline(vertexes2);

Group group = new Group("MyPolylines", new[] { p1, p2 });

DxfDocument doc = new DxfDocument();

// it is not necessary to add both polylines before adding the group
//doc.AddEntity(p1);
//doc.AddEntity(p2);

// adding the group to a document will also add the entities in case they do not exist
doc.Groups.Add(group);
doc.Save("Group.dxf");
I hope this is what you are looking for.

Daniel