<?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 Re: How to set layer state in Civil 3d to current document using c#? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12026998#M8589</link>
    <description>&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;But here&amp;nbsp;&lt;A title="Link here" href="http://Thank%20you for the reply.  But here&amp;nbsp;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff-3859b43c1209703a8386e0f.htm,topicNumber=d0e14574&amp;nbsp;I unable to select individual layer state. In Restore command we can get preview of individual layer state . But I am not getting which&amp;nbsp;Layer settings are restored as viewport overrides(4th parameter in method -RestoreLayerState&amp;nbsp;(1,2,3,4)&amp;nbsp; ). If any one knows or already works can post" target="_blank" rel="noopener"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff-3859b43c1209703a8386e0f.htm,topicNumber=d0e14574&amp;nbsp;&lt;/A&gt;I unable to select individual layer state. In Restore command we can get preview of individual layer state . But I am not getting what should I select in parameter 4-&amp;nbsp;&lt;SPAN&gt;Layer settings are restored as viewport overrides(4th parameter in method -&lt;SPAN class=""&gt;RestoreLayerState&lt;/SPAN&gt;&amp;nbsp;(1,2,3,4)&amp;nbsp; ). If any one knows or already works can post&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2023 07:38:00 GMT</pubDate>
    <dc:creator>swarali_kulkarni4KMYK</dc:creator>
    <dc:date>2023-06-12T07:38:00Z</dc:date>
    <item>
      <title>How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12022120#M8587</link>
      <description>&lt;P&gt;I want to select layer state, based on the layer state the particular layer state should set to the current document. can any one has worked on same or anybody know about it can post the answer&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 07:59:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12022120#M8587</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-12T07:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12026737#M8588</link>
      <description>&lt;P&gt;Go through this link&amp;nbsp;&lt;A href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff-3859b43c1209703a8386e0f.htm,topicNumber=d0e14574" target="_blank"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff-3859b43c1209703a8386e0f.htm,topicNumber=d0e14574&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This might solve your query.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 04:47:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12026737#M8588</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-12T04:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12026998#M8589</link>
      <description>&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;But here&amp;nbsp;&lt;A title="Link here" href="http://Thank%20you for the reply.  But here&amp;nbsp;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff-3859b43c1209703a8386e0f.htm,topicNumber=d0e14574&amp;nbsp;I unable to select individual layer state. In Restore command we can get preview of individual layer state . But I am not getting which&amp;nbsp;Layer settings are restored as viewport overrides(4th parameter in method -RestoreLayerState&amp;nbsp;(1,2,3,4)&amp;nbsp; ). If any one knows or already works can post" target="_blank" rel="noopener"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff-3859b43c1209703a8386e0f.htm,topicNumber=d0e14574&amp;nbsp;&lt;/A&gt;I unable to select individual layer state. In Restore command we can get preview of individual layer state . But I am not getting what should I select in parameter 4-&amp;nbsp;&lt;SPAN&gt;Layer settings are restored as viewport overrides(4th parameter in method -&lt;SPAN class=""&gt;RestoreLayerState&lt;/SPAN&gt;&amp;nbsp;(1,2,3,4)&amp;nbsp; ). If any one knows or already works can post&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 07:38:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12026998#M8589</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-12T07:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027273#M8590</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13442618"&gt;@swarali_kulkarni4KMYK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Suppose you have layer state 'ABCD' in your drawing and if you use following block of code, it will restore the values of&amp;nbsp;LayerStateMasks that you have mentioned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;string sLyrStName = "ABCD";&lt;BR /&gt;if (acLyrStMan.HasLayerState(sLyrStName) == true)&lt;BR /&gt;{&lt;BR /&gt;acLyrStMan.RestoreLayerState(sLyrStName,&lt;BR /&gt;ObjectId.Null,&lt;BR /&gt;1,&lt;BR /&gt;LayerStateMasks.LineWeight);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In above code,&amp;nbsp;LayerStateMasks.LineWeight will restore the value of lineweight to the value defined in layer state. You can add more LayerStateMasks in the same if you want other properties to be changed as well.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 09:33:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027273#M8590</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-12T09:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027445#M8591</link>
      <description>&lt;P&gt;Is this will work for selection of layer state?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 11:23:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027445#M8591</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-12T11:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027579#M8592</link>
      <description>&lt;P&gt;Selection of Layer state means? Can you elaborate?&lt;BR /&gt;Do you mean you have more than one layer states and you want to select one of them and restore?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 12:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027579#M8592</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-12T12:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027695#M8593</link>
      <description>&lt;P&gt;I appreciate your interest in finding solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, exactly. There are multiple layer states in current document. I want to select any one from them. So i am trying to use restore method to select layer state. will it work?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 13:07:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027695#M8593</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-12T13:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027785#M8594</link>
      <description>&lt;P&gt;Yes it is possible. You can read layer states in current drawing. You can read layer states in current drawing and add those in prompt for user to select. Use following block of code. It will read layer states in current drawing and show them as keywords to user. User can select those layer states.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ArrayList layerStates = acLyrStMan.GetLayerStateNames(false, false);
            PromptKeywordOptions opts = new PromptKeywordOptions("Select layer state");
            for(int i=0;i&amp;lt; layerStates.Count; i++)
            {
                opts.Keywords.Add(layerStates[i].ToString());
            }
            PromptResult result = ed.GetKeywords(opts);
            if(result.Status == PromptStatus.OK)
            {
                if (acLyrStMan.HasLayerState(result.StringResult) == true)
                {
                    acLyrStMan.RestoreLayerState(result.StringResult,
                                                 ObjectId.Null,
                                                 1,
                                                 LayerStateMasks.LineWeight);
                }
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 13:39:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12027785#M8594</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-12T13:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12030446#M8595</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We have list of layer states in current document, We have to implement the functionality where based on layer state selection&amp;nbsp; we have to restore that layer state. Please check screenshot. I have tried RestoreLayerState(LayerstateName,ObjectId.Null,1,LayerStateMasks.LineWeight). No Objects are getting selected. Here once click on restore every layer state get selected and set to the current document. Same I want to implement but layer state not getting added&amp;nbsp; to current document by using restore method.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="swarali_kulkarni4KMYK_4-1686661123499.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1226909i9FBD0E451DBF3B3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="swarali_kulkarni4KMYK_4-1686661123499.png" alt="swarali_kulkarni4KMYK_4-1686661123499.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Otherwise I have to implement&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="swarali_kulkarni4KMYK_0-1686661598226.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1226913i7501B5825426EE39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="swarali_kulkarni4KMYK_0-1686661598226.png" alt="swarali_kulkarni4KMYK_0-1686661598226.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Same as per above. after selecting any layer state here, on document also has to reflect same changes as per layer state as already implemented in Civil 3d.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 13:08:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12030446#M8595</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-13T13:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12035144#M8596</link>
      <description>&lt;P&gt;Ok. When I passed any one&amp;nbsp;LayerStateMask as a 4th parameter to&amp;nbsp;RestoreLayerState() method, it only restored the passed LayerStateMask and also chosen layer state was not assigned to current document. But then I tried adding all the&amp;nbsp;LayerStateMasks then the chosen layer state was assigned to current document. Please try following block of code&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ArrayList layerStates = acLyrStMan.GetLayerStateNames(false, false);
            PromptKeywordOptions opts = new PromptKeywordOptions("Select layer state");
            for(int i=0;i&amp;lt; layerStates.Count; i++)
            {
                opts.Keywords.Add(layerStates[i].ToString());
            }
            PromptResult result = ed.GetKeywords(opts);
            if(result.Status == PromptStatus.OK)
            {
                if (acLyrStMan.HasLayerState(result.StringResult) == true)
                {
                    acLyrStMan.RestoreLayerState(result.StringResult,
                                                 ObjectId.Null,
                                                 1,
                                                 LayerStateMasks.On | LayerStateMasks.Frozen | LayerStateMasks.Locked | LayerStateMasks.Color|LayerStateMasks.LineType|LayerStateMasks.LineWeight|LayerStateMasks.Transparency|LayerStateMasks.PlotStyle|LayerStateMasks.Plot|LayerStateMasks.NewViewport);
                }
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 03:40:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12035144#M8596</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-15T03:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12043078#M8597</link>
      <description>&lt;P&gt;Is it really worked?&amp;nbsp;&lt;SPAN&gt;assigned&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;chosen layer state to current document? I have tried but not&amp;nbsp; assigning to current document.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 05:18:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12043078#M8597</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-19T05:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12043158#M8598</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13442618"&gt;@swarali_kulkarni4KMYK&lt;/a&gt;&amp;nbsp;, Yes it is working. Can you tell me which way you chose to select particular layer state?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 06:04:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12043158#M8598</guid>
      <dc:creator>shubhamraut221195</dc:creator>
      <dc:date>2023-06-19T06:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to set layer state in Civil 3d to current document using c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12043837#M8599</link>
      <description>&lt;P&gt;Yes, Its working, thank you so much for your time to find the solution.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 11:28:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-layer-state-in-civil-3d-to-current-document-using-c/m-p/12043837#M8599</guid>
      <dc:creator>swarali_kulkarni4KMYK</dc:creator>
      <dc:date>2023-06-19T11:28:48Z</dc:date>
    </item>
  </channel>
</rss>

