<?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: calling autoCAD commands in VB.NET while CommandFlags.session is enabled in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6003930#M14596</link>
    <description>&lt;P&gt;Thanks for your reply Civil3DReminders.com. I am now deleting layer in .NET. However, my problem remains. I used to call commands, including those defined in lisp within a vb.net code I created for Civil 3d 2013. but now in civil 3d 2016, the same code can't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is what used to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim app As AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;/P&gt;&lt;P&gt;app.ActiveDocument.SendCommand("setq3" &amp;amp; vbCr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where setq3 is either an autoCad civil 3d command or a lisp command. I could even call a lisp function by enclosing it in blackets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know there has been changes since CAD 2015 (like removing fibers) but I am hopping I could still find a working way to send a command in autocad civil 3d 2016 while "commandFlags.session is enabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2016 03:18:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-01-25T03:18:36Z</dc:date>
    <item>
      <title>calling autoCAD commands in VB.NET while CommandFlags.session is enabled</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6002958#M14594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to call "-laydel" command from vb.net code. However I am getting error when using 'commandflags.session. How can I call an autocad command in vb.net while commandflags.session is enabled? I need to keep commandflags.session for my application. please see part of my code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;CommandMethod("cmdLaydel", CommandFlags.Modal + CommandFlags.Session)&amp;gt;&lt;/P&gt;&lt;P&gt;Public Sub deleteLayers2()&lt;/P&gt;&lt;P&gt;Dim layerTodel As String = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("USERS2")&lt;/P&gt;&lt;P&gt;Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;/P&gt;&lt;P&gt;Dim ed As Editor = doc.Editor&lt;/P&gt;&lt;P&gt;ed.Command("-laydel", "n", layerTodel, "", "y", "")&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2016 20:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6002958#M14594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-23T20:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: calling autoCAD commands in VB.NET while CommandFlags.session is enabled</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6003911#M14595</link>
      <description>&lt;P&gt;I've never had luck sending stuff to the command line. It always seems to do it in the order I don't want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd just delete the layer in .NET:&amp;nbsp;&lt;A href="http://forums.autodesk.com/t5/net/how-to-delete-layer-using-c-net/td-p/2409218/page/2" target="_blank"&gt;http://forums.autodesk.com/t5/net/how-to-delete-layer-using-c-net/td-p/2409218/page/2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 02:39:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6003911#M14595</guid>
      <dc:creator>Civil3DReminders_com</dc:creator>
      <dc:date>2016-01-25T02:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: calling autoCAD commands in VB.NET while CommandFlags.session is enabled</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6003930#M14596</link>
      <description>&lt;P&gt;Thanks for your reply Civil3DReminders.com. I am now deleting layer in .NET. However, my problem remains. I used to call commands, including those defined in lisp within a vb.net code I created for Civil 3d 2013. but now in civil 3d 2016, the same code can't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is what used to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim app As AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication&lt;/P&gt;&lt;P&gt;app.ActiveDocument.SendCommand("setq3" &amp;amp; vbCr)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where setq3 is either an autoCad civil 3d command or a lisp command. I could even call a lisp function by enclosing it in blackets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know there has been changes since CAD 2015 (like removing fibers) but I am hopping I could still find a working way to send a command in autocad civil 3d 2016 while "commandFlags.session is enabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 03:18:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/calling-autocad-commands-in-vb-net-while-commandflags-session-is/m-p/6003930#M14596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-25T03:18:36Z</dc:date>
    </item>
  </channel>
</rss>

