<?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: LayoutManager.Current gives 'Common Language Runtime detected an invalid program.' Why? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611633#M5205</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You cannot access to the .NET API (e.g. Autodesk.AutoCAD.DatabaseServices) from a standalone application (exe).&lt;/P&gt;
&lt;P&gt;To be able to acces to the .NET API, you have to build a class library project (DLL) and NETLOAD it in a runing AutoCAD session.&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-C8C65D7A-EC3A-42D8-BF02-4B13C2EA1A4B" target="_blank" rel="noopener"&gt;this topic&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 16:12:00 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2024-03-04T16:12:00Z</dc:date>
    <item>
      <title>LayoutManager.Current gives 'Common Language Runtime detected an invalid program.' Why?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611547#M5204</link>
      <description>&lt;P&gt;Dim pasteDwg As AcadDocument&lt;BR /&gt;Dim acadApp As AcadApplication&lt;BR /&gt;acadApp = GetObject(, "AutoCAD.Application.24.2")&lt;BR /&gt;pasteDwg = acadApp.ActiveDocument&lt;BR /&gt;Dim lm As LayoutManager = LayoutManager.Current&lt;BR /&gt;&lt;BR /&gt;The second it hits LayoutManager.Current I get hit with COmmon Language Runtime Detected an Invalid program&lt;BR /&gt;I have these imports&lt;BR /&gt;Imports Autodesk.AutoCAD.Interop&lt;BR /&gt;Imports Autodesk.AutoCAD.Interop.Common&lt;BR /&gt;Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;Imports Autodesk.AutoCAD.ApplicationServices&lt;BR /&gt;*Note Runtime and APplication serverices are greyed out and considered unnecessary but I believe I will need them.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 15:54:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611547#M5204</guid>
      <dc:creator>QNashJSRL8</dc:creator>
      <dc:date>2024-03-04T15:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: LayoutManager.Current gives 'Common Language Runtime detected an invalid program.' Why?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611633#M5205</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You cannot access to the .NET API (e.g. Autodesk.AutoCAD.DatabaseServices) from a standalone application (exe).&lt;/P&gt;
&lt;P&gt;To be able to acces to the .NET API, you have to build a class library project (DLL) and NETLOAD it in a runing AutoCAD session.&lt;/P&gt;
&lt;P&gt;See &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-C8C65D7A-EC3A-42D8-BF02-4B13C2EA1A4B" target="_blank" rel="noopener"&gt;this topic&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 16:12:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611633#M5205</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-03-04T16:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: LayoutManager.Current gives 'Common Language Runtime detected an invalid program.' Why?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611717#M5206</link>
      <description>&lt;P&gt;Thank you for the quick response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So, checking if I understand correctly, I want to use AuctoCAD.Interop methods and objects when talking to AutoCad?&lt;BR /&gt;&lt;BR /&gt;My end goal is to create layouts from a given template, identify the templates several viewports in paper space and put some alignments from model space into the viewports depending on specific criteria. I think I need layout manager for this but is there another way. Would you know a substitute for layout manager?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 16:23:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611717#M5206</guid>
      <dc:creator>QNashJSRL8</dc:creator>
      <dc:date>2024-03-04T16:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: LayoutManager.Current gives 'Common Language Runtime detected an invalid program.' Why?</title>
      <link>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611834#M5207</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15145592"&gt;@QNashJSRL8&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to use AuctoCAD.Interop methods and objects when talking to AutoCad&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If so, you're stack to the COM/ActiveX API which does not provide any 'LayoutManager'.&lt;/P&gt;
&lt;P&gt;Have a look at the &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-36BF58F3-537D-4B59-BEFE-2D0FEF5A4443" target="_blank" rel="noopener"&gt;ActiveX Developer's Guide&lt;/A&gt; and the &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-5D302758-ED3F-4062-A254-FB57BAB01C44" target="_blank" rel="noopener"&gt;ActiveX Reference Guide&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While using the COM/ActiveX API (more in VB), you should post in the &lt;A href="https://forums.autodesk.com/t5/vba/bd-p/33" target="_blank" rel="noopener"&gt;VBA forum&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 16:42:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/layoutmanager-current-gives-common-language-runtime-detected-an/m-p/12611834#M5207</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-03-04T16:42:10Z</dc:date>
    </item>
  </channel>
</rss>

