<?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: Visual Basic.net dll in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647153#M46831</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Public ReadOnly Property ThisDrawing() As &lt;FONT color="#FF6600"&gt;AcadDocuments&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Get&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Return Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.&lt;FONT color="#FF6600"&gt;MdiActiveDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;End Get&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can only return an object that matches the type of the property, and &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;MdiActiveDocument&lt;/FONT&gt; is completly different to the &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;AcadDocuments&lt;/FONT&gt; type.&lt;/P&gt;
&lt;P&gt;So assuming you want to have the COM/ActiveX type that describes your drawing-document (singular! not &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;AcadDocument&lt;/FONT&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#FF6600"&gt;&lt;STRONG&gt;s&lt;/STRONG&gt;&lt;/FONT&gt;) you should change the code to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Public ReadOnly Property ThisDrawing() As &lt;FONT color="#FF6600"&gt;AcadDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Get&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Return CType(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument, AcadDocument)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;End Get&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH, - alfred -&lt;/P&gt;
&lt;P&gt;PS: set your property "copy-local" for your reference to AcCoreMgd.dll to false, in your screenshot it looks like it's set to true.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Nov 2013 18:53:11 GMT</pubDate>
    <dc:creator>Alfred.NESWADBA</dc:creator>
    <dc:date>2013-11-23T18:53:11Z</dc:date>
    <item>
      <title>Visual Basic.net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647077#M46830</link>
      <description>&lt;P&gt;Good afternoon everyone, I am working&amp;nbsp;with&amp;nbsp;microsoft visual&amp;nbsp;basic&amp;nbsp;2010 and&amp;nbsp;create aPlugIM&amp;nbsp;Tries&amp;nbsp;to AutoCAD&amp;nbsp;2013&amp;nbsp;I can not&amp;nbsp;recreate the&amp;nbsp;ThisDrawing&amp;nbsp;variable,&amp;nbsp;put&amp;nbsp;the reference&amp;nbsp;as&amp;nbsp;attached&amp;nbsp;image,&amp;nbsp;the problem&amp;nbsp;occurs&amp;nbsp;on the line that&amp;nbsp;is&amp;nbsp;red&amp;nbsp;in color&amp;nbsp;soon afterMdiActiveDocument&amp;nbsp;not appear&amp;nbsp;to&amp;nbsp;AcadDocument&amp;nbsp;option&amp;nbsp;to terminate&amp;nbsp;the line&amp;nbsp;I believe it should&amp;nbsp;be missing&amp;nbsp;some&amp;nbsp;dll&amp;nbsp;if anyone else has&amp;nbsp;experienced this&amp;nbsp;and&amp;nbsp;can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Class AdskCommads&lt;BR /&gt;Public ReadOnly Property ThisDrawing() As AcadDocuments&lt;BR /&gt;Get&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Return Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;/FONT&gt;&lt;BR /&gt;End Get&lt;BR /&gt;End Property&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/71529iE4D63E0D8759968C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" align="center" title="Doc1.pdf" alt="Doc1.pdf" /&gt;&lt;BR /&gt;End Class&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 17:05:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647077#M46830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-23T17:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647153#M46831</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Public ReadOnly Property ThisDrawing() As &lt;FONT color="#FF6600"&gt;AcadDocuments&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Get&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Return Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.&lt;FONT color="#FF6600"&gt;MdiActiveDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;End Get&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can only return an object that matches the type of the property, and &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;MdiActiveDocument&lt;/FONT&gt; is completly different to the &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;AcadDocuments&lt;/FONT&gt; type.&lt;/P&gt;
&lt;P&gt;So assuming you want to have the COM/ActiveX type that describes your drawing-document (singular! not &lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;AcadDocument&lt;/FONT&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#FF6600"&gt;&lt;STRONG&gt;s&lt;/STRONG&gt;&lt;/FONT&gt;) you should change the code to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Public ReadOnly Property ThisDrawing() As &lt;FONT color="#FF6600"&gt;AcadDocument&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Get&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;Return CType(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument, AcadDocument)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="lucida sans unicode,lucida sans" color="#666699"&gt;End Get&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH, - alfred -&lt;/P&gt;
&lt;P&gt;PS: set your property "copy-local" for your reference to AcCoreMgd.dll to false, in your screenshot it looks like it's set to true.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 18:53:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647153#M46831</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-11-23T18:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647193#M46832</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thanks for replying worked perfectly for creating the variable ThisDrawing.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When I run in AutoCAD, it shows me the following message that is in the picture, do not know how to proceed, if you can give me any other tips as I am new to. NET. (See the program code attached)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry for any errors in English because I live in Brazil.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/71533i90149130C1A644BE/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" align="center" title="Mensagem.jpg" alt="Mensagem.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 21:07:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647193#M46832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-23T21:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647195#M46833</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you try to cast an object from type Document (managed) to an AcadDocument (COM/ActiveX object), that does not work that way.&lt;/P&gt;
&lt;P&gt;So the next step is to tell the debugger to stop at exceptions ... you can see then in debug-mode what line of code raises that exception.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 21:09:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4647195#M46833</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2013-11-23T21:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.net dll</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4654549#M46834</link>
      <description>&lt;P&gt;Obrigado. por respomder as minhas dúvidas&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you. By respomder my doubts&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 23:35:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-dll/m-p/4654549#M46834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-26T23:35:33Z</dc:date>
    </item>
  </channel>
</rss>

