LayerTableRecord.ViewportVisibilityDefault property not changed

LayerTableRecord.ViewportVisibilityDefault property not changed

Anonymous
Not applicable
1,039 Views
2 Replies
Message 1 of 3

LayerTableRecord.ViewportVisibilityDefault property not changed

Anonymous
Not applicable

 

 

 

            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:

 

1252i455A5DB0C47D75EC

 

 

 

 

 

0 Likes
1,040 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

If you want it frozen in viewports

ViewportVisibilityDefault = true;

 

1254iBC637AC1909A89F3

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you!

0 Likes