<?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 layer and LayerState Problem? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337115#M84903</link>
    <description>question 1:&lt;BR /&gt;
I want turn on ,unlock,unfrozen all layer,the following is my code,but question is when run the code , the entity are all despeared, i have to regen the drawing and the entity could visible.&lt;BR /&gt;
            Database curdb;  &lt;BR /&gt;
            Autodesk.AutoCAD.DatabaseServices.TransactionManager tm; &lt;BR /&gt;
            Transaction myT&lt;BR /&gt;
&lt;BR /&gt;
            curdb = Application.DocumentManager.MdiActiveDocument.Database;&lt;BR /&gt;
            tm = curdb.TransactionManager;&lt;BR /&gt;
            using (myT = tm.StartTransaction())&lt;BR /&gt;
            {&lt;BR /&gt;
                LayerTable lt = (LayerTable)tm.GetObject(curdb.LayerTableId, OpenMode.ForRead);&lt;BR /&gt;
                foreach (ObjectId objId in lt)&lt;BR /&gt;
                {&lt;BR /&gt;
                    LayerTableRecord ltr = (LayerTableRecord)tm.GetObject(objId, OpenMode.ForWrite);&lt;BR /&gt;
                    if (ltr.IsLocked) { ltr.IsLocked = false; }&lt;BR /&gt;
                    if (ltr.IsFrozen) { ltr.IsFrozen = false; }&lt;BR /&gt;
                    if (ltr.IsOff) { ltr.IsOff = false; }&lt;BR /&gt;
                }&lt;BR /&gt;
                myT.Commit();&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
question 2:&lt;BR /&gt;
I can save layerstate,but I can't restore it, I wonder my problem is i don't know the use of parmeter: undefinedlayerstatepolicy. could anyone show me some code of how to use RestoreLayerState method in c#</description>
    <pubDate>Thu, 26 May 2005 08:12:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-05-26T08:12:40Z</dc:date>
    <item>
      <title>layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337115#M84903</link>
      <description>question 1:&lt;BR /&gt;
I want turn on ,unlock,unfrozen all layer,the following is my code,but question is when run the code , the entity are all despeared, i have to regen the drawing and the entity could visible.&lt;BR /&gt;
            Database curdb;  &lt;BR /&gt;
            Autodesk.AutoCAD.DatabaseServices.TransactionManager tm; &lt;BR /&gt;
            Transaction myT&lt;BR /&gt;
&lt;BR /&gt;
            curdb = Application.DocumentManager.MdiActiveDocument.Database;&lt;BR /&gt;
            tm = curdb.TransactionManager;&lt;BR /&gt;
            using (myT = tm.StartTransaction())&lt;BR /&gt;
            {&lt;BR /&gt;
                LayerTable lt = (LayerTable)tm.GetObject(curdb.LayerTableId, OpenMode.ForRead);&lt;BR /&gt;
                foreach (ObjectId objId in lt)&lt;BR /&gt;
                {&lt;BR /&gt;
                    LayerTableRecord ltr = (LayerTableRecord)tm.GetObject(objId, OpenMode.ForWrite);&lt;BR /&gt;
                    if (ltr.IsLocked) { ltr.IsLocked = false; }&lt;BR /&gt;
                    if (ltr.IsFrozen) { ltr.IsFrozen = false; }&lt;BR /&gt;
                    if (ltr.IsOff) { ltr.IsOff = false; }&lt;BR /&gt;
                }&lt;BR /&gt;
                myT.Commit();&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
question 2:&lt;BR /&gt;
I can save layerstate,but I can't restore it, I wonder my problem is i don't know the use of parmeter: undefinedlayerstatepolicy. could anyone show me some code of how to use RestoreLayerState method in c#</description>
      <pubDate>Thu, 26 May 2005 08:12:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337115#M84903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-26T08:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337116#M84904</link>
      <description>one more question:&lt;BR /&gt;
I read some post about problem of  layer mananger command and vs 2005 ,but I still don't know how to fix it. could someone explain it in detail. &lt;BR /&gt;
thanks in advance.</description>
      <pubDate>Thu, 26 May 2005 08:54:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337116#M84904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-26T08:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337117#M84905</link>
      <description>1. This is normal. Thawing a layer requires a regen. The layer command does &lt;BR /&gt;
a regen (although an optimized one that only affects the objects on the &lt;BR /&gt;
layers that are being thawed)&lt;BR /&gt;
&lt;BR /&gt;
2.The following works fine for me:&lt;BR /&gt;
LayerStateManager lsm = &lt;BR /&gt;
Application.DocumentManager.MdiActiveDocument.Database.LayerStateManager;&lt;BR /&gt;
&lt;BR /&gt;
//restore the On/Off state and Color&lt;BR /&gt;
&lt;BR /&gt;
lsm.RestoreLayerState("test",ObjectId.Null,0,LayerStateMasks.On | &lt;BR /&gt;
LayerStateMasks.Color);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4856968@discussion.autodesk.com...&lt;BR /&gt;
question 1:&lt;BR /&gt;
I want turn on ,unlock,unfrozen all layer,the following is my code,but &lt;BR /&gt;
question is when run the code , the entity are all despeared, i have to &lt;BR /&gt;
regen the drawing and the entity could visible.&lt;BR /&gt;
            Database curdb;&lt;BR /&gt;
            Autodesk.AutoCAD.DatabaseServices.TransactionManager tm;&lt;BR /&gt;
            Transaction myT&lt;BR /&gt;
&lt;BR /&gt;
            curdb = Application.DocumentManager.MdiActiveDocument.Database;&lt;BR /&gt;
            tm = curdb.TransactionManager;&lt;BR /&gt;
            using (myT = tm.StartTransaction())&lt;BR /&gt;
            {&lt;BR /&gt;
                LayerTable lt = (LayerTable)tm.GetObject(curdb.LayerTableId, &lt;BR /&gt;
OpenMode.ForRead);&lt;BR /&gt;
                foreach (ObjectId objId in lt)&lt;BR /&gt;
                {&lt;BR /&gt;
                    LayerTableRecord ltr = &lt;BR /&gt;
(LayerTableRecord)tm.GetObject(objId, OpenMode.ForWrite);&lt;BR /&gt;
                    if (ltr.IsLocked) { ltr.IsLocked = false; }&lt;BR /&gt;
                    if (ltr.IsFrozen) { ltr.IsFrozen = false; }&lt;BR /&gt;
                    if (ltr.IsOff) { ltr.IsOff = false; }&lt;BR /&gt;
                }&lt;BR /&gt;
                myT.Commit();&lt;BR /&gt;
            }&lt;BR /&gt;
&lt;BR /&gt;
question 2:&lt;BR /&gt;
I can save layerstate,but I can't restore it, I wonder my problem is i don't &lt;BR /&gt;
know the use of parmeter: undefinedlayerstatepolicy. could anyone show me &lt;BR /&gt;
some code of how to use RestoreLayerState method in c#&lt;/NETCAI&gt;</description>
      <pubDate>Thu, 26 May 2005 15:35:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337117#M84905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-26T15:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337118#M84906</link>
      <description>thanks.&lt;BR /&gt;
1.my question is: does dot net api has a simliar method same as the method in activex ( Regen(AcRegenType.acActiveViewport) )  , I don't wish to use SendStringToExecute to do this.&lt;BR /&gt;
2. for the second question , I have found the reason, because my code is converted from activex , in activex ,LayerStateMasks has a acAll enum, but in net api LayerStateMasks hasn't same one , so I have to combine all the enum to meet my need.&lt;BR /&gt;
3. could you  tell me how to fix the error in layer manager command?</description>
      <pubDate>Fri, 27 May 2005 00:13:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337118#M84906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-27T00:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337119#M84907</link>
      <description>1. No, the .net api doesn't have a regen but you can easily call the method &lt;BR /&gt;
on the COM API.&lt;BR /&gt;
3. You mean when running with .NET 2.0 Beta2? You need to bind acad back to &lt;BR /&gt;
.net 1.1 (use acad.exe.config to do this). If you want to use .net 2.0 &lt;BR /&gt;
features then you are out of luck: you need to wait until the next .net 2.0 &lt;BR /&gt;
beta or ctp drop. (where they fixed the issue we are running into)&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4858285@discussion.autodesk.com...&lt;BR /&gt;
thanks.&lt;BR /&gt;
1.my question is: does dot net api has a simliar method same as the method &lt;BR /&gt;
in activex ( Regen(AcRegenType.acActiveViewport) )  , I don't wish to use &lt;BR /&gt;
SendStringToExecute to do this.&lt;BR /&gt;
2. for the second question , I have found the reason, because my code is &lt;BR /&gt;
converted from activex , in activex ,LayerStateMasks has a acAll enum, but &lt;BR /&gt;
in net api LayerStateMasks hasn't same one , so I have to combine all the &lt;BR /&gt;
enum to meet my need.&lt;BR /&gt;
3. could you  tell me how to fix the error in layer manager command?&lt;/NETCAI&gt;</description>
      <pubDate>Fri, 27 May 2005 01:40:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337119#M84907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-27T01:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337120#M84908</link>
      <description>thanks albert.&lt;BR /&gt;
yes, I use .net 2.0 beta,I am not famliar with acad.exe.config format ,could you explain in detail how to modify it?</description>
      <pubDate>Sat, 28 May 2005 01:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337120#M84908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-28T01:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: layer and LayerState Problem?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337121#M84909</link>
      <description>acad.exe.config should look like this on your machine:&lt;BR /&gt;
----&lt;BR /&gt;
&lt;CONFIGURATION&gt;&lt;BR /&gt;
   &lt;STARTUP&gt;&lt;BR /&gt;
&lt;!--We always use the latest version of the framework installed on the &lt;BR&gt;
computer. If you&lt;BR&gt;
are having problems then explicitly specify .NET 1.1 by uncommenting the &lt;BR&gt;
following line.&lt;BR&gt;
  &lt;supportedRuntime version="v1.1.4322"/&gt;&lt;BR&gt;
--&gt;&lt;BR /&gt;
   &lt;/STARTUP&gt;&lt;BR /&gt;
&lt;/CONFIGURATION&gt;&lt;BR /&gt;
---&lt;BR /&gt;
&lt;BR /&gt;
After following the instructions in the comment you should have something &lt;BR /&gt;
like this:&lt;BR /&gt;
&lt;BR /&gt;
----&lt;BR /&gt;
&lt;CONFIGURATION&gt;&lt;BR /&gt;
   &lt;STARTUP&gt;&lt;BR /&gt;
      &lt;SUPPORTEDRUNTIME version="v1.1.4322"&gt;&lt;/SUPPORTEDRUNTIME&gt;&lt;BR /&gt;
   &lt;/STARTUP&gt;&lt;BR /&gt;
&lt;/CONFIGURATION&gt;&lt;BR /&gt;
----&lt;BR /&gt;
&lt;BR /&gt;
&lt;NETCAI&gt; wrote in message news:4859405@discussion.autodesk.com...&lt;BR /&gt;
thanks albert.&lt;BR /&gt;
yes, I use .net 2.0 beta,I am not famliar with acad.exe.config format ,could &lt;BR /&gt;
you explain in detail how to modify it?&lt;/NETCAI&gt;</description>
      <pubDate>Sun, 29 May 2005 17:35:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layer-and-layerstate-problem/m-p/1337121#M84909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-29T17:35:27Z</dc:date>
    </item>
  </channel>
</rss>

