Code example:
Let's say this one here, a DrawBox() function.
Polyline plBox = new Polyline(4)
{
Closed = true,
Layer = layer,
Normal = Vector3d.ZAxis,
LineWeight = LineWeight.ByLayer
};
plBox.AddVertexAt(0, new Point2d(startPoint.X, startPoint.Y), 0.0, 1.0, 1.0);
Point3d endPoint = AcadTools.CalculateEndPoint(startPoint, length, orientationDepart);
plBox.AddVertexAt(1, new Point2d(endPoint.X, endPoint.Y), 0.0, 1.0, 1.0);
endPoint = AcadTools.CalculateEndPoint(endPoint, width, MathTools.AddAngle(orientationDepart, 90));
plBox.AddVertexAt(2, new Point2d(endPoint.X, endPoint.Y), 0.0, 1.0, 1.0);
endPoint = AcadTools.CalculateEndPoint(endPoint, length, MathTools.AddAngle(orientationDepart, 180));
plBox.AddVertexAt(3, new Point2d(endPoint.X, endPoint.Y), 0.0, 1.0, 1.0);
btr.AppendEntity(plBox);
Tx.AddNewlyCreatedDBObject(plBox, true);
Group.AppendEntity(plBox.ObjectId);
If you call the DrawBox() routine multiple times passing it the same Group..
DrawBox(Group1, StartPoint1, ...);
DrawBox(Group1, StartPoint2, ...);
DrawBox(Group1, StartPoint3, ...);
And then CTRL-Z (_u), each of the polylines added will be removed one by one, I would like to remove all of them at once.
Would be easy if the entities where be added to the group and then the group added to the database.
Am I doing something wrong?
Thank you