foreach (var objectId in objectIds)
{
using (var polygon = SelectionHelper.GetCadPolygon(objectId, transaction, OpenMode.ForWrite))
{
if (polygon == null)
continue;
if (style == null)
continue;
var idMap = new IdMapping();
using (var clonePolygon = (Entity)polygon.DeepClone(blockTableRecord, idMap, false))
{
clonePolygon.SetDatabaseDefaults();
clonePolygon.Layer = layerNamePlan;
transaction.AddNewlyCreatedDBObject(clonePolygon, true);
objectIdCollection.Add(clonePolygon.ObjectId);
GeometryClassSetter.SetStyle(clonePolygon, classItem, Common.CadDatabase, transaction, Condition.ADDED_TO_PLAN);
GeometryClassSetter.SetLandType(clonePolygon, classItemPlan.ClassID, transaction);
}
}
}
if (objectIdCollection.Count > 0)
{
var drawOrderTable = (DrawOrderTable)transaction.GetObject(blockTableRecord.DrawOrderTableId, OpenMode.ForWrite);
drawOrderTable.MoveToBottom(objectIdCollection);
}