<?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 update SettingsCmdCreatePoints Layer programmatically? in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11990233#M3590</link>
    <description>Thanks for your help in solving this problem!</description>
    <pubDate>Fri, 26 May 2023 01:17:31 GMT</pubDate>
    <dc:creator>varshaauti27</dc:creator>
    <dc:date>2023-05-26T01:17:31Z</dc:date>
    <item>
      <title>How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11988526#M3584</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for the way to update&amp;nbsp;SettingsCmdCreatePoints layer programmatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="varshaauti27_1-1685005382233.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1219124i1367D6088657FE33/image-size/medium?v=v2&amp;amp;px=400" role="button" title="varshaauti27_1-1685005382233.png" alt="varshaauti27_1-1685005382233.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my sample code :&amp;nbsp;&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; using (Transaction tr = acadDocument.Database.TransactionManager.StartTransaction())
                {
                    var pointSettings = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument.Settings.GetSettings&amp;lt;Autodesk.Civil.Settings.SettingsCmdCreatePoints&amp;gt;() as SettingsCmdCreatePoints;
                    pointSettings.Layer.Layer.Value = "New Layer";

                    tr.Commit();
                }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code works fine no error so far,&amp;nbsp; but does not update "Create Points" layer&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 12:22:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11988526#M3584</guid>
      <dc:creator>varshaauti27</dc:creator>
      <dc:date>2023-05-25T12:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11988996#M3585</link>
      <description>&lt;P&gt;Your code appears to work for me. (My apologies, I use VB instead of C#. One of these days I'll make the switch.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Dim ps As SettingsCmdCreatePoints = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument.Settings.GetSettings(Of Autodesk.Civil.Settings.SettingsCmdCreatePoints)

ps.Layer.Layer.Value = "MyCreatePointsLayer"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code doesn't necessarily need to be wrapped in a transaction. The layer does need to exist or it will cause an exception. However you state that you are not encountering an error. Seems odd.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 14:43:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11988996#M3585</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2023-05-25T14:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989040#M3586</link>
      <description>Code does work but when I open Create Points settings I don't see updated layer. (FYI, I am using existing layer)</description>
      <pubDate>Thu, 25 May 2023 15:05:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989040#M3586</guid>
      <dc:creator>varshaauti27</dc:creator>
      <dc:date>2023-05-25T15:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989069#M3587</link>
      <description>&lt;P&gt;How is your code being executed? Dialog or command?&amp;nbsp; The following code example works provided that the layer MyCreatePointsLayer already exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VB.Net&lt;/P&gt;&lt;LI-CODE lang="general"&gt;&amp;lt;CommandMethod("SetCreatePointsLayer")&amp;gt;
Public Sub CmdSetCreatePointsLayer()
   Dim ps As SettingsCmdCreatePoints = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument.Settings.GetSettings(Of Autodesk.Civil.Settings.SettingsCmdCreatePoints)
   ps.Layer.Layer.Value = "MyCreatePointsLayer"
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C#.Net&lt;/P&gt;&lt;LI-CODE lang="general"&gt;[CommandMethod("SetCreatePointsLayer")]
public void CmdSetCreatePointsLayer()
{
    SettingsCmdCreatePoints ps = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument.Settings.GetSettings&amp;lt;Autodesk.Civil.Settings.SettingsCmdCreatePoints&amp;gt;;
    ps.Layer.Layer.Value = "MyCreatePointsLayer";
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 May 2023 15:24:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989069#M3587</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2023-05-25T15:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989100#M3588</link>
      <description>I am using CommandMethod that opens WinForm dialog. And I am trying to swap layer on Button click.&lt;BR /&gt;I did try to execute code through CommandMethod , it did work as expected. Looks like there is issue with executing above snippet with WinForm Dialog. Can you help me to resolve this issue?</description>
      <pubDate>Thu, 25 May 2023 15:41:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989100#M3588</guid>
      <dc:creator>varshaauti27</dc:creator>
      <dc:date>2023-05-25T15:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989131#M3589</link>
      <description>&lt;P&gt;If you are executing from a dialog box you should use the "SendStringToExecute" method of the document.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;aDoc.SendStringToExecute("SetCreatePointsLayer ", false, false, false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: Added a space after the command name in the first argument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am assuming that your dialog is modal and not modeless. If you are using a modeless dialog then, inside the CreatePointsLayer command you will need to lock the document.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 16:36:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11989131#M3589</guid>
      <dc:creator>hippe013</dc:creator>
      <dc:date>2023-05-25T16:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11990233#M3590</link>
      <description>Thanks for your help in solving this problem!</description>
      <pubDate>Fri, 26 May 2023 01:17:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11990233#M3590</guid>
      <dc:creator>varshaauti27</dc:creator>
      <dc:date>2023-05-26T01:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to update SettingsCmdCreatePoints Layer programmatically?</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11991535#M3591</link>
      <description>It is not because of WinForm Dialog (or WPF, for that matter) directly. It is because of how the dialog is displayed: MODAL, or MODELESS. If it is modeless dialog (it looks this is what you are using), the best practice is to call SendStringToExecute() to execute an existing CommandMethod, rather than locking current document with your code and then do something.</description>
      <pubDate>Fri, 26 May 2023 14:18:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/how-to-update-settingscmdcreatepoints-layer-programmatically/m-p/11991535#M3591</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-05-26T14:18:28Z</dc:date>
    </item>
  </channel>
</rss>

