<?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: Commands didn't work if I open file by double click in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668232#M52823</link>
    <description>&lt;P&gt;This is one of the most frustrating aspects of AutoCAD's managed API. There are quite a few reasons why commands are not registered, but usually it is due to an exception being thrown in IExtensionApplication.Initialize().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should always wrap all of the code in that method inside a try/catch block, and in the latter show a message on the command line or via some other means, to let you know what happened.&lt;/P&gt;</description>
    <pubDate>Sun, 21 Oct 2012 14:26:05 GMT</pubDate>
    <dc:creator>DiningPhilosopher</dc:creator>
    <dc:date>2012-10-21T14:26:05Z</dc:date>
    <item>
      <title>Commands didn't work if I open file by double click</title>
      <link>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668112#M52822</link>
      <description>&lt;P&gt;I made my plug-in for Autocad 2012.&lt;/P&gt;&lt;P&gt;I register my plug-in in registry and so it's autoloaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I open Autocad I saw my toolbar, my message from IExtensionApplication.Initialize and all my commands (marked as [assembly: CommandClass) works fine. No problem.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;BUT! If I open autocad file by double click - autocad opened. Now I saw my toolbar, saw my message from Initialize!&lt;BR /&gt;But any commands didn't work. Autocad said that command is unknown. What can be a problem? My be in Autocad version? I have student version and startup message about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pavel.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2012 05:59:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668112#M52822</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-21T05:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Commands didn't work if I open file by double click</title>
      <link>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668232#M52823</link>
      <description>&lt;P&gt;This is one of the most frustrating aspects of AutoCAD's managed API. There are quite a few reasons why commands are not registered, but usually it is due to an exception being thrown in IExtensionApplication.Initialize().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should always wrap all of the code in that method inside a try/catch block, and in the latter show a message on the command line or via some other means, to let you know what happened.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2012 14:26:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668232#M52823</guid>
      <dc:creator>DiningPhilosopher</dc:creator>
      <dc:date>2012-10-21T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Commands didn't work if I open file by double click</title>
      <link>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668254#M52824</link>
      <description>&lt;P&gt;Dear DiningPhilosopher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are absolutely right. I had exception in Init because in first case&amp;nbsp;Acad execute&amp;nbsp;RIBBON command before open file, but in second Init was before RIBBON. So&amp;nbsp;no RIBBON in Init and exception in this block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now all works fine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Pavel.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2012 15:29:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668254#M52824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-21T15:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Commands didn't work if I open file by double click</title>
      <link>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668360#M52825</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;Dear DiningPhilosopher,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are absolutely right. I had exception in Init because in first case&amp;nbsp;Acad execute&amp;nbsp;RIBBON command before open file, but in second Init was before RIBBON. So&amp;nbsp;no RIBBON in Init and exception in this block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now all works fine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Pavel.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When working with the ribbon, I don't assume that it will appear when AutoCAD starts. The user might not have it visible, and can show it at any time. What I usually do is first check to see if the Ribbon is created using RibbonServices.RibbonPaletteSet. If it is null, the ribbon isn't visible, so I add a handler to the RibbonServices.RibbonPaletteSetCreated event. In the handler of that event, the ribbon has not been initialized yet, so I add another handler to the RibbonPaletteSet's Loaded event, which will fire after the ribbon has been fully initialized.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2012 23:13:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3668360#M52825</guid>
      <dc:creator>DiningPhilosopher</dc:creator>
      <dc:date>2012-10-21T23:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Commands didn't work if I open file by double click</title>
      <link>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3675872#M52826</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1052889"&gt;@DiningPhilosopher&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When working with the ribbon, I don't assume that it will appear when AutoCAD starts. The user might not have it visible, and can show it at any time. What I usually do is first check to see if the Ribbon is created using RibbonServices.RibbonPaletteSet. If it is null, the ribbon isn't visible, so I add a handler to the RibbonServices.RibbonPaletteSetCreated event. In the handler of that event, the ribbon has not been initialized yet, so I add another handler to the RibbonPaletteSet's Loaded event, which will fire after the ribbon has been fully initialized.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Sorry, but I can't find RibbonServices class and events.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2012 19:20:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/commands-didn-t-work-if-i-open-file-by-double-click/m-p/3675872#M52826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-26T19:20:08Z</dc:date>
    </item>
  </channel>
</rss>

