<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic LayerTableRecord.ViewportVisibilityDefault property not changed in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798966#M63484</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            using (Transaction t = dwg.TransactionManager.StartTransaction())// dwg -&amp;gt; Document
            {
                LayerTable lt = (LayerTable) t.GetObject(db.LayerTableId, OpenMode.ForRead);
                foreach (ObjectId layerId in lt)
                {
                    if (layerId != db.LayerZero)// db -&amp;gt; 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();
            }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;result screen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="http://forums.autodesk.com/t5/image/serverpage/image-id/1252i455A5DB0C47D75EC/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="1252i455A5DB0C47D75EC" align="center" title="17.10.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Oct 2010 15:57:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-10-17T15:57:31Z</dc:date>
    <item>
      <title>LayerTableRecord.ViewportVisibilityDefault property not changed</title>
      <link>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798966#M63484</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            using (Transaction t = dwg.TransactionManager.StartTransaction())// dwg -&amp;gt; Document
            {
                LayerTable lt = (LayerTable) t.GetObject(db.LayerTableId, OpenMode.ForRead);
                foreach (ObjectId layerId in lt)
                {
                    if (layerId != db.LayerZero)// db -&amp;gt; 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();
            }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;result screen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="http://forums.autodesk.com/t5/image/serverpage/image-id/1252i455A5DB0C47D75EC/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="1252i455A5DB0C47D75EC" align="center" title="17.10.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2010 15:57:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798966#M63484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-17T15:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: LayerTableRecord.ViewportVisibilityDefault property not changed</title>
      <link>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798978#M63485</link>
      <description>&lt;P&gt;If you want it frozen in viewports&lt;/P&gt;&lt;P&gt;ViewportVisibilityDefault = true;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="http://forums.autodesk.com/t5/image/serverpage/image-id/1254iBC637AC1909A89F3/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="1254iBC637AC1909A89F3" align="center" title="2.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2010 16:18:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798978#M63485</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-17T16:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: LayerTableRecord.ViewportVisibilityDefault property not changed</title>
      <link>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798986#M63486</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2010 16:32:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layertablerecord-viewportvisibilitydefault-property-not-changed/m-p/2798986#M63486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-17T16:32:33Z</dc:date>
    </item>
  </channel>
</rss>

