<?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: Get command name from autocad electrical in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12258158#M7245</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I don't know how to use, could you explain in detail?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 05:29:52 GMT</pubDate>
    <dc:creator>kebby70</dc:creator>
    <dc:date>2023-09-22T05:29:52Z</dc:date>
    <item>
      <title>Get command name from autocad electrical</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12257883#M7242</link>
      <description>&lt;P&gt;I would like to add a function to check whether AEWIRENO which a command of autocad electrical has been executed.&lt;BR /&gt;Commands such as copy and move can be checked for execution, but AEWIRENO is not recognized in GLOBALNAME.&lt;BR /&gt;please tell me how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is below&lt;/P&gt;&lt;P&gt;public void Initialize()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentLockModeChanged += new DocumentLockModeChangedEventHandler(vetoCommand);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private void vetoCommand(object sender, DocumentLockModeChangedEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;if (e.GlobalCommandName == "COPY")&lt;BR /&gt;{&lt;BR /&gt;e.Veto();&lt;BR /&gt;MessageBox.Show("COPY");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (e.GlobalCommandName == "MOVE")&lt;BR /&gt;{&lt;BR /&gt;e.Veto();&lt;BR /&gt;MessageBox.Show("MOVE");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (e.GlobalCommandName == "AEWIRENO")&lt;BR /&gt;{&lt;BR /&gt;e.Veto();&lt;BR /&gt;MessageBox.Show("AEWIRENO");&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 01:48:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12257883#M7242</guid>
      <dc:creator>kebby70</dc:creator>
      <dc:date>2023-09-22T01:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get command name from autocad electrical</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12257911#M7243</link>
      <description>&lt;P&gt;Maybe it defined in group name. Try groupName or add globalName.&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="image.png" style="width: 647px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1269888i3CF709103AC2A5F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 02:15:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12257911#M7243</guid>
      <dc:creator>ditran7577</dc:creator>
      <dc:date>2023-09-22T02:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get command name from autocad electrical</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12258154#M7244</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 05:29:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12258154#M7244</guid>
      <dc:creator>kebby70</dc:creator>
      <dc:date>2023-09-22T05:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get command name from autocad electrical</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12258158#M7245</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I don't know how to use, could you explain in detail?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 05:29:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12258158#M7245</guid>
      <dc:creator>kebby70</dc:creator>
      <dc:date>2023-09-22T05:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get command name from autocad electrical</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12259850#M7246</link>
      <description>&lt;P&gt;You can easily find out why the said command is not caught in the DocumentLockModeChanged event handler by simply place a break point in the event handler to examine the event argument, and run the said command.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the beak point is hit, you can then examine what exactly the GlobalCommand value is; if not hit, the said command is not a "real" command, it is probably a LISP routine defined as (defun c:xxxxx....), which would not raise DocumentLockModeChanged event when it begins (but its code could raise this event along with its execution, if the lisp routine has statement like (command "xxxxx"....)...).&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 18:06:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-command-name-from-autocad-electrical/m-p/12259850#M7246</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2023-09-22T18:06:36Z</dc:date>
    </item>
  </channel>
</rss>

