Community
using (Transaction t = dwg.TransactionManager.StartTransaction())// dwg -> Document { LayerTable lt = (LayerTable) t.GetObject(db.LayerTableId, OpenMode.ForRead); foreach (ObjectId layerId in lt) { if (layerId != db.LayerZero)// db -> Database { bool x = false; LayerTableRecord layer = (LayerTableRecord)t.GetObject(layerId, OpenMode.ForWrite); layer.Color = Color.FromColor(System.Drawing.Color.Red); EntityColor color = layer.EntityColor; layer.Description = "примечание"; layer.IsFrozen = x; layer.IsHidden = x; layer.IsLocked = x; layer.IsOff = x; layer.IsPlottable = x; layer.IsReconciled = x; bool xx = layer.IsUsed; ObjectId lineType = layer.LinetypeObjectId; layer.LineWeight = LineWeight.LineWeight158; ObjectId mat = layer.MaterialId; string psName = layer.PlotStyleName; ObjectId psId = layer.PlotStyleNameId; DBObject a = null; if (psId != ObjectId.Null) { a = t.GetObject(psId, OpenMode.ForRead); } layer.Transparency = new Transparency((byte)50); layer.ViewportVisibilityDefault = x;// x = false, but... it property not changed.. why???. it's .net api realisation mistake? } } t.Commit(); }
result screen: