<?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: Event AcadDocument_Activate() in DotNET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306033#M57501</link>
    <description>&lt;P&gt;Thanks for the answer Alfred, the blog is helpfull...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AutoNetloading my dll is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I open a specific drawing&lt;/P&gt;&lt;P&gt;2) my macro autostarts only when this specific drawing is opened.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In vba, I add vba code (AcadDocument_Activate) in this specific drawing, which trigger my macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to add dotnet events in a spécific dwg?? It seems no... Is there another way??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2012 16:07:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-25T16:07:08Z</dc:date>
    <item>
      <title>Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3305959#M57499</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm looking for a way to autostart my dotnet macro according to a certain drawing opening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to auto netload my dll&lt;/P&gt;&lt;P&gt;I know in vba using events to start the macro when my drawing is opened :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Private Sub AcadDocument_Activate()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Start.MyVbaMacro&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how do I manage it in DotNET? I don't want to use vbaenabler...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michel&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 15:37:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3305959#M57499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-25T15:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3305989#M57500</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; I know in vba using events to start the macro when my drawing is opened&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;To get EventHandler defined you first have to load an application. At least within one application you don't have a chance to get loaded only for specific drawings as the descission "load the DLL or not" has to be done by a program and so it has to be loaded at least the part that defines the EventHandler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To automatically get dotNET applications loaded look to &lt;A target="_self" href="http://through-the-interface.typepad.com/through_the_interface/2006/09/automatic_loadi.html"&gt;&amp;gt;&amp;gt;&amp;gt;this blog&amp;lt;&amp;lt;&amp;lt;&lt;/A&gt; to see how you can load a dotNET-DLL automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And one primitive method (if you don't want to make changes to the registry) could be to write a LISP-command into the ACAD.LSP so the DLL get loaded with AutoCAD-startup:&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;(command "_-NETLOAD" "\\mypath\\mydll.dll")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 15:48:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3305989#M57500</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-25T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306033#M57501</link>
      <description>&lt;P&gt;Thanks for the answer Alfred, the blog is helpfull...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AutoNetloading my dll is OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I open a specific drawing&lt;/P&gt;&lt;P&gt;2) my macro autostarts only when this specific drawing is opened.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In vba, I add vba code (AcadDocument_Activate) in this specific drawing, which trigger my macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to add dotnet events in a spécific dwg?? It seems no... Is there another way??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 16:07:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306033#M57501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-25T16:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306061#M57502</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#666699"&gt;&amp;gt;&amp;gt; Is it possible to add dotnet events in a spécific dwg??&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;No, you can load your DLL with the application with a defined event handler that catches every drawing-open ... then check if the DWG is a drawing of interest or not, so run your commands for this DWG (or not).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 16:15:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306061#M57502</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-01-25T16:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306063#M57503</link>
      <description>&lt;P&gt;You can use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public event DocumentCollectionEventHandler DocumentToBeActivated;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;event of Application.DocumentManager. but you must run it in ApplicationContext.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 16:15:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306063#M57503</guid>
      <dc:creator>cincir</dc:creator>
      <dc:date>2012-01-25T16:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306093#M57504</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hummm, Lovely DotNet automations ;-(((&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know the name of that drawing... Perhaps the user had to rename it according to naming convention purpose...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I'm going to make a classic Menu Button, and check first if the drawing contains the prerequisites...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help.&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 16:28:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306093#M57504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-25T16:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306165#M57505</link>
      <description>&lt;P&gt;if not my memory serves me wrong Database object has some fields for user defined values. you can check them also to determine if it is proper Document to process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you are welcome.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 17:15:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306165#M57505</guid>
      <dc:creator>cincir</dc:creator>
      <dc:date>2012-01-25T17:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Event AcadDocument_Activate() in DotNET</title>
      <link>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306261#M57506</link>
      <description>&lt;P&gt;hi. i think you can use the var USERI1, USERI2 ... 5&lt;/P&gt;&lt;P&gt;this saved in the drawing so you need to check a value in this var when the doc opened&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2012 18:18:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/event-acaddocument-activate-in-dotnet/m-p/3306261#M57506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-25T18:18:37Z</dc:date>
    </item>
  </channel>
</rss>

