<?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: DllImport for acedGetEnv.... in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009376#M44152</link>
    <description>&lt;P&gt;Which Sysvar:&amp;nbsp; ACADPREFIX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, saw your first sentance but for some reason i didnt think it was the same thing as importing from the .exe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Forgive me&lt;/STRONG&gt;, Ive just tried it by importing from ACCORE.DLL and that works, for reading &amp;amp; writing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your other link is to use the interop library, which I wanted to avoid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Many thanks for your help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How did you find that acedGetEnv had moved?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 03 May 2014 10:13:39 GMT</pubDate>
    <dc:creator>StormyC</dc:creator>
    <dc:date>2014-05-03T10:13:39Z</dc:date>
    <item>
      <title>DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009282#M44145</link>
      <description>&lt;P&gt;Got what I think is an odd situation.&amp;nbsp; Im trying to access the support paths using the dll import that can be found in a number of sites.&amp;nbsp; Problem is, the entry point doesnt seem to exist - im sure it worked before.. any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AutoCAD2014, Win7 64, VSExpress2010, C#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="acerror.png" align="center" title="acerror.png" border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/98526iA1B3EA844CAF6186/image-size/original?v=mpbl-1&amp;amp;px=-1" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 08:20:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009282#M44145</guid>
      <dc:creator>StormyC</dc:creator>
      <dc:date>2014-05-03T08:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009298#M44146</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;acedGetEnv is placed in ACCORE.DLL and not in ACAD.EXE (I guess since 2013).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: why don't you use the more direct option to get sysvar's:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;&amp;nbsp;&amp;nbsp; Public Shared Function GetSystemVariable(name As String) As Object&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Member von Autodesk.AutoCAD.ApplicationServices.Core.Application&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 09:02:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009298#M44146</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2014-05-03T09:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009304#M44147</link>
      <description>&lt;P&gt;Thanks for the reply, but, I dont think the support file search path is a system variable that can be edited that way.&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 09:14:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009304#M44147</guid>
      <dc:creator>StormyC</dc:creator>
      <dc:date>2014-05-03T09:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009308#M44148</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for editing:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;&amp;nbsp;&amp;nbsp; Public Shared Sub &lt;STRONG&gt;Set&lt;/STRONG&gt;SystemVariable(name As String, value As Object)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Member von Autodesk.AutoCAD.ApplicationServices.Core.Application&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 09:16:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009308#M44148</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2014-05-03T09:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009312#M44149</link>
      <description>&lt;P&gt;The system variable is readonly....&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 09:27:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009312#M44149</guid>
      <dc:creator>StormyC</dc:creator>
      <dc:date>2014-05-03T09:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009334#M44150</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="#000080"&gt;&amp;gt;&amp;gt; The system variable is readonly....&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Which sysvar?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And back to start:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#000080"&gt;&amp;gt;&amp;gt; Problem is, the entry point doesnt seem to exist - im sure it worked before&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Have you seen my first sentence in my first post?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;acedGetEnv is placed in ACCORE.DLL and not in ACAD.EXE (I guess since 2013).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At least:&lt;/P&gt;
&lt;P&gt;Does &lt;A href="https://forums.autodesk.com/t5/NET/Add-Support-paths-via-DLL-vb-net/td-p/4960074" target="_self"&gt;&amp;gt;&amp;gt;&amp;gt;that thread&amp;lt;&amp;lt;&amp;lt;&lt;/A&gt; abotu adding a path to the list of support paths help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 09:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009334#M44150</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2014-05-03T09:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009358#M44151</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As Alfred said, since AutoCAD 2013, the acad.exe file have been splited into acad.exe and accore.dll.&lt;/P&gt;
&lt;P&gt;Try replacing acad.exe with accore.dll in the DllImport arguments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, to get and/or set support paths, you can &lt;A href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff2566ffd511ff6f8c7ca-43d3.htm,topicNumber=d0e8745" target="_blank"&gt;use COM to access to AutoCAD preferences&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This needs to reference the COM librairies or use the Dynamic type. The inconvenients of the first route are the advantages of the second one and vice versa.&lt;/P&gt;
&lt;P&gt;Referencing COM libraries means using static typing with type checking at compile time which is a great help during edition time (intellisense), but COM librairies are verion and processor architecture dependant which may be an inconvenient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using COM libraries&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Runtime;

namespace AcadPreferencesStaticTyping
{
    public class CommandMethods
    {
        [CommandMethod("Test")]
        public void Test()
        {
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            AcadPreferences prefs = (AcadPreferences)Application.Preferences;
            string[] supportPaths = prefs.Files.SupportPath.Split(';');
            foreach (string str in supportPaths)
            {
                ed.WriteMessage("\n{0}", str);
            }
        }
    }
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using Dynamic type&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;

namespace AcadPreferencesDynamicTyping
{
    public class CommandMethods
    {
        [CommandMethod("Test")]
        public void Test()
        {
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            dynamic prefs = Application.Preferences;
            string[] supportPaths = prefs.Files.SupportPath.Split(';');
            foreach (string str in supportPaths)
            {
                ed.WriteMessage("\n{0}", str);
            }
        }
    }
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the codes are very similar, it's quite easy to reference the COM libraries while writing an debugging and, when all works as expected, remove these references and replace the COM types with the 'dynamic' keyword.&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 10:35:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009358#M44151</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2014-05-03T10:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009376#M44152</link>
      <description>&lt;P&gt;Which Sysvar:&amp;nbsp; ACADPREFIX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, saw your first sentance but for some reason i didnt think it was the same thing as importing from the .exe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Forgive me&lt;/STRONG&gt;, Ive just tried it by importing from ACCORE.DLL and that works, for reading &amp;amp; writing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your other link is to use the interop library, which I wanted to avoid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Many thanks for your help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How did you find that acedGetEnv had moved?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 10:13:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009376#M44152</guid>
      <dc:creator>StormyC</dc:creator>
      <dc:date>2014-05-03T10:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009386#M44153</link>
      <description>&lt;P&gt;Gilles, many thanks for that reply - I had read about dynamic types but forgotten about them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may just rewrite it to use those.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks both!&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 10:18:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009386#M44153</guid>
      <dc:creator>StormyC</dc:creator>
      <dc:date>2014-05-03T10:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: DllImport for acedGetEnv....</title>
      <link>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009394#M44154</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;&amp;gt;&amp;gt; Forgive me,&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You are welcome, no need to appologize, the most important thing is you got it solved and you can continue to work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#000080"&gt;&amp;gt;&amp;gt; How did you find that acedGetEnv had moved?&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;For Invokes and similar things I use Dependency Walker &lt;A href="http://www.dependencywalker.com/" target="_self"&gt;&amp;gt;&amp;gt;&amp;gt;click&amp;lt;&amp;lt;&amp;lt;&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Sat, 03 May 2014 10:19:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dllimport-for-acedgetenv/m-p/5009394#M44154</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2014-05-03T10:19:56Z</dc:date>
    </item>
  </channel>
</rss>

