<?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: SendCommand  with error &amp;quot;Unhandled Access violation Reading 0xfffffffff in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678233#M28228</link>
    <description>&lt;P&gt;Y&lt;SPAN class=""&gt;ou can also easily parallelize the process to run in parallel as many consoles as available cores.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

namespace AcCoreConsoleSample
{
    class Program
    {
        static void Main(string[] args)
        {
            RunParallel();
        }

        const string coreConsolePath = @"C:\Program Files\Autodesk\AutoCAD 2013\accoreconsole.exe";

        static void RunParallel()
        {
            Parallel.For(0, 10, i =&amp;gt;
            {
                string filename = "C:\\Temp\\ee" + i + ".dwg";
                if (File.Exists(filename))
                    File.Delete(filename);
                string scriptPath = @"C:\Temp\CoreConsoleScript_" + i + ".scr";
                using (var writer = new StreamWriter(scriptPath, false))
                {
                    writer.WriteLine("_.CIRCLE 0,0 100.0");
                    writer.WriteLine("_.ZOOM _object _last\n");
                    writer.WriteLine("_.SAVEAS 2004");
                    writer.WriteLine(filename);
                }
                string args = "/s " + scriptPath;
                var startInfo = new ProcessStartInfo(coreConsolePath, args);
                startInfo.WindowStyle = ProcessWindowStyle.Normal;
                var process = Process.Start(startInfo);
                process.WaitForExit();
                File.Delete(scriptPath);
            });
        }
    }
}
&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Jan 2018 10:54:20 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2018-01-10T10:54:20Z</dc:date>
    <item>
      <title>SendCommand  with error "Unhandled Access violation Reading 0xffffffffff ......</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7674181#M28212</link>
      <description>&lt;P&gt;I have &amp;nbsp; thousands of &amp;nbsp; dwg file &amp;nbsp;, i &amp;nbsp;wan't &amp;nbsp;open it &amp;nbsp;,then &amp;nbsp;create a &amp;nbsp;closed line &amp;nbsp;, then &amp;nbsp;get &amp;nbsp;" maptrim" &amp;nbsp;command &amp;nbsp;, then &amp;nbsp;save it . I operate one by one.&lt;/P&gt;&lt;P&gt;I run my &amp;nbsp;code &amp;nbsp;, &amp;nbsp; i &amp;nbsp;get &amp;nbsp;the &amp;nbsp;error "Unhandled Access violation Reading Oxffffffff &amp;nbsp;Exception at &amp;nbsp;e9e1460bh" &amp;nbsp;when &amp;nbsp;I &amp;nbsp;get about &amp;nbsp; the &amp;nbsp;fifith &amp;nbsp;file&amp;nbsp;&lt;/P&gt;&lt;P&gt;i use &amp;nbsp;the &amp;nbsp;AutoCAD Map 2015+ .net + &amp;nbsp;com&lt;/P&gt;&lt;PRE&gt;  using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.Threading.Tasks;&lt;BR /&gt;using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;using Autodesk.Gis.Map.Platform.Utils;&lt;BR /&gt;using AutoCAD;      &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  AcadApplication app = Application.AcadApplication as AcadApplication;
                if (!System.IO.File.Exists(@"C:\template500.dwg"))
                {
                    Util.PrintLn("\n  template is not exsit : C:\\template500.dwg");
                    return "err";
                }
                Document DOC = Application.DocumentManager.Open(@"C:\template500.dwg", false);
                List&amp;lt;string&amp;gt; LstFiles = new List&amp;lt;string&amp;gt;();
                List&amp;lt;string&amp;gt; LstCode = GetTuFuNumber.GetTuFuNum(MapCode);
                for (int i = 0; i &amp;lt; LstCode.Count; i++)
                {
                    if (System.IO.File.Exists(Path + "\\" + LstCode[i] + ".dwg"))
                    {

                        LstFiles.Add(Path + "\\" + LstCode[i] + ".dwg");
                    }

                }
                string s = "";
                for (int k = 0; k &amp;lt; LstFiles.Count; k++)
                {
                    s += LstFiles[k] + ",";
                }


                //********load  the  file  and  connected  file 
                Database destDb = DOC.Database;
                using (DocumentLock docLock1 = DOC.LockDocument())
                {
                    for (int i = 0; i &amp;lt; LstFiles.Count; i++)
                    {

                        Database sourceDb = new Database(false, true);
                        sourceDb.ReadDwgFile(LstFiles[i], System.IO.FileShare.Read, false, null);
                        var SourceObjectIds = new ObjectIdCollection();
                        Autodesk.AutoCAD.DatabaseServices.TransactionManager SourceTm = sourceDb.TransactionManager;

                        using (Transaction trans = destDb.TransactionManager.StartTransaction())
                        {

                            var blockTable = (BlockTable)trans.GetObject(destDb.BlockTableId, OpenMode.ForRead);
                            using (Transaction extTrans = sourceDb.TransactionManager.StartTransaction())
                            {
                                dynamic extBlockTable = (BlockTable)extTrans.GetObject(sourceDb.BlockTableId, OpenMode.ForRead);
                                dynamic extModelSpace = (BlockTableRecord)extTrans.GetObject(extBlockTable[BlockTableRecord.ModelSpace], OpenMode.ForRead);
                                foreach (ObjectId id in extModelSpace)
                                {
                                    SourceObjectIds.Add(id);
                                }

                            }
                            sourceDb.CloseInput(true);
                            dynamic idmapping = new IdMapping();
                            // destDb.WblockCloneObjects(SourceObjectIds, destDb.BlockTableId, idmapping, DuplicateRecordCloning.Replace, false);
                            destDb.WblockCloneObjects(SourceObjectIds, blockTable[BlockTableRecord.ModelSpace], idmapping, DuplicateRecordCloning.Replace, false);
                            trans.Commit();

                        }


                    }
                }
                CWriteLog.Msg(targetPath, "finish  load file ");
                Util.PrintLn("create  polyline.......");
                app.ActiveDocument.SendCommand("filedia 0 \n");
               
                Polyline line = getLine(MapCode);
               
                //****  add  the polyline  to modespace

                using (DOC.LockDocument())
                {
                    ObjectId entityID;
                    using (var tr = DOC.TransactionManager.StartTransaction())
                    {
                        var modelspace = (BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(DOC.Database), OpenMode.ForWrite);
                        // Circle circ = new Circle(Point3d.Origin, Vector3d.ZAxis, 100.0);
                        entityID = modelspace.AppendEntity(line);

                        tr.AddNewlyCreatedDBObject(line, true);
                        tr.Commit();

                    }
                  
                    //**************begion  to  maptrim 
                    Util.PrintLn("begion to maptrim ");
                    CWriteLog.Msg(targetPath, "begin to maptrim ");
                   
                        app.ActiveDocument.SendCommand("_.MAPTRIM\nS\nlast\nN\nN\nO\nY\nN\nR\nY\n\n");
                        CWriteLog.Msg(targetPath, " finish maptrim ");
                     Util.PrintLn("finish maptrim ");

                     CWriteLog.Msg(targetPath, "delete polyline ");
                    
                    DeleleEnity(entityID);
             
                    CWriteLog.Msg(targetPath, "save  .......");
                    string saveFolder = targetPath + "\\" + "outPut";
                    if (!System.IO.Directory.Exists(saveFolder))
                    {
                        System.IO.Directory.CreateDirectory(saveFolder);
                    }
                    string filename = saveFolder + "\\" + MapCode + ".dwg"; ;
                    app.ActiveDocument.SendCommand("_.SAVEAS\n2004\n" + filename + "\nY\n\n");&lt;/PRE&gt;&lt;P&gt;everytime &amp;nbsp;I &amp;nbsp;get &amp;nbsp;the error&amp;nbsp; at &amp;nbsp;"&lt;/P&gt;&lt;PRE&gt;  app.ActiveDocument.SendCommand("_.MAPTRIM\nS\nlast\nN\nN\nO\nY\nN\nR\nY\n\n");&lt;/PRE&gt;&lt;P&gt;"&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 06:58:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7674181#M28212</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-09T06:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7674639#M28213</link>
      <description>&lt;P&gt;SendCommand() is asynchronous, which means that the commands that you pass it do not execute until after your code exits and returns control to AutoCAD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You cannot do batch scripting this way. If you have 'thousands of dwg files', you will probably need to start and shutdown AutoCAD for each one, or every 10 or so files, but in order to execute commands your code must run in the document execution context, or you must find a way to wait until the command has finished (using an event possibly) before you resume processing the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Batch processing is best done by controlling the entire process from an out-of-process ActiveX client. You can write the code that processes each file in .NET, and then expose it as a command that would be started using SendCommand() from the out-of-process controller. It must then wait until the command has finished before closing the file and opening the next one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;I have &amp;nbsp; thousands of &amp;nbsp; dwg file &amp;nbsp;, i &amp;nbsp;wan't &amp;nbsp;open it &amp;nbsp;,then &amp;nbsp;create a &amp;nbsp;closed line &amp;nbsp;, then &amp;nbsp;get &amp;nbsp;" maptrim" &amp;nbsp;command &amp;nbsp;, then &amp;nbsp;save it . I operate one by one.&lt;/P&gt;&lt;P&gt;I run my &amp;nbsp;code &amp;nbsp;, &amp;nbsp; i &amp;nbsp;get &amp;nbsp;the &amp;nbsp;error "Unhandled Access violation Reading Oxffffffff &amp;nbsp;Exception at &amp;nbsp;e9e1460bh" &amp;nbsp;when &amp;nbsp;I &amp;nbsp;get about &amp;nbsp; the &amp;nbsp;fifith &amp;nbsp;file&amp;nbsp;&lt;/P&gt;&lt;P&gt;i use &amp;nbsp;the &amp;nbsp;AutoCAD Map 2015+ .net + &amp;nbsp;com&lt;/P&gt;&lt;PRE&gt;  using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.Threading.Tasks;&lt;BR /&gt;using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;using Autodesk.Gis.Map.Platform.Utils;&lt;BR /&gt;using AutoCAD;      &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  AcadApplication app = Application.AcadApplication as AcadApplication;
                if (!System.IO.File.Exists(@"C:\template500.dwg"))
                {
                    Util.PrintLn("\n  template is not exsit : C:\\template500.dwg");
                    return "err";
                }
                Document DOC = Application.DocumentManager.Open(@"C:\template500.dwg", false);
                List&amp;lt;string&amp;gt; LstFiles = new List&amp;lt;string&amp;gt;();
                List&amp;lt;string&amp;gt; LstCode = GetTuFuNumber.GetTuFuNum(MapCode);
                for (int i = 0; i &amp;lt; LstCode.Count; i++)
                {
                    if (System.IO.File.Exists(Path + "\\" + LstCode[i] + ".dwg"))
                    {

                        LstFiles.Add(Path + "\\" + LstCode[i] + ".dwg");
                    }

                }
                string s = "";
                for (int k = 0; k &amp;lt; LstFiles.Count; k++)
                {
                    s += LstFiles[k] + ",";
                }


                //********load  the  file  and  connected  file 
                Database destDb = DOC.Database;
                using (DocumentLock docLock1 = DOC.LockDocument())
                {
                    for (int i = 0; i &amp;lt; LstFiles.Count; i++)
                    {

                        Database sourceDb = new Database(false, true);
                        sourceDb.ReadDwgFile(LstFiles[i], System.IO.FileShare.Read, false, null);
                        var SourceObjectIds = new ObjectIdCollection();
                        Autodesk.AutoCAD.DatabaseServices.TransactionManager SourceTm = sourceDb.TransactionManager;

                        using (Transaction trans = destDb.TransactionManager.StartTransaction())
                        {

                            var blockTable = (BlockTable)trans.GetObject(destDb.BlockTableId, OpenMode.ForRead);
                            using (Transaction extTrans = sourceDb.TransactionManager.StartTransaction())
                            {
                                dynamic extBlockTable = (BlockTable)extTrans.GetObject(sourceDb.BlockTableId, OpenMode.ForRead);
                                dynamic extModelSpace = (BlockTableRecord)extTrans.GetObject(extBlockTable[BlockTableRecord.ModelSpace], OpenMode.ForRead);
                                foreach (ObjectId id in extModelSpace)
                                {
                                    SourceObjectIds.Add(id);
                                }

                            }
                            sourceDb.CloseInput(true);
                            dynamic idmapping = new IdMapping();
                            // destDb.WblockCloneObjects(SourceObjectIds, destDb.BlockTableId, idmapping, DuplicateRecordCloning.Replace, false);
                            destDb.WblockCloneObjects(SourceObjectIds, blockTable[BlockTableRecord.ModelSpace], idmapping, DuplicateRecordCloning.Replace, false);
                            trans.Commit();

                        }


                    }
                }
                CWriteLog.Msg(targetPath, "finish  load file ");
                Util.PrintLn("create  polyline.......");
                app.ActiveDocument.SendCommand("filedia 0 \n");
               
                Polyline line = getLine(MapCode);
               
                //****  add  the polyline  to modespace

                using (DOC.LockDocument())
                {
                    ObjectId entityID;
                    using (var tr = DOC.TransactionManager.StartTransaction())
                    {
                        var modelspace = (BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(DOC.Database), OpenMode.ForWrite);
                        // Circle circ = new Circle(Point3d.Origin, Vector3d.ZAxis, 100.0);
                        entityID = modelspace.AppendEntity(line);

                        tr.AddNewlyCreatedDBObject(line, true);
                        tr.Commit();

                    }
                  
                    //**************begion  to  maptrim 
                    Util.PrintLn("begion to maptrim ");
                    CWriteLog.Msg(targetPath, "begin to maptrim ");
                   
                        app.ActiveDocument.SendCommand("_.MAPTRIM\nS\nlast\nN\nN\nO\nY\nN\nR\nY\n\n");
                        CWriteLog.Msg(targetPath, " finish maptrim ");
                     Util.PrintLn("finish maptrim ");

                     CWriteLog.Msg(targetPath, "delete polyline ");
                    
                    DeleleEnity(entityID);
             
                    CWriteLog.Msg(targetPath, "save  .......");
                    string saveFolder = targetPath + "\\" + "outPut";
                    if (!System.IO.Directory.Exists(saveFolder))
                    {
                        System.IO.Directory.CreateDirectory(saveFolder);
                    }
                    string filename = saveFolder + "\\" + MapCode + ".dwg"; ;
                    app.ActiveDocument.SendCommand("_.SAVEAS\n2004\n" + filename + "\nY\n\n");&lt;/PRE&gt;&lt;P&gt;everytime &amp;nbsp;I &amp;nbsp;get &amp;nbsp;the error&amp;nbsp; at &amp;nbsp;"&lt;/P&gt;&lt;PRE&gt;  app.ActiveDocument.SendCommand("_.MAPTRIM\nS\nlast\nN\nN\nO\nY\nN\nR\nY\n\n");&lt;/PRE&gt;&lt;P&gt;"&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 10:37:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7674639#M28213</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2018-01-09T10:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7676953#M28214</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a DLLImport to define a method which calls internals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[DllImport("accore.dll",
 CharSet = CharSet.Unicode,
 CallingConvention = CallingConvention.Cdecl,
 EntryPoint = "acedCmd")]
public static extern int acedCmd(IntPtr vlist);

[DllImport("accore.dll",
 CharSet = CharSet.Unicode,
 CallingConvention = CallingConvention.Cdecl,
 EntryPoint = "acedCmdS")]
public static extern int acedCmdS(System.IntPtr vlist);&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;This is an example:&lt;/P&gt;&lt;PRE&gt;m_ResultBuffer = new ResultBuffer();
m_ResultBuffer.Add(new TypedValue(5005, "_.SAVEAS"));
m_ResultBuffer.Add(new TypedValue(5005, m_ResultBuffer.Add(new TypedValue(5005, m_FileName));

if (System.IO.File.Exists(m_FileName) == true)
{
     m_ResultBuffer.Add(new TypedValue(5005, "_YES"));
}
if (m_ACADVersionDouble &amp;gt;= 21)
{
     acedCmdS(m_ResultBuffer.UnmanagedObject);
}
else if (m_ACADVersionDouble &amp;gt;= 19 &amp;amp;&amp;amp; m_ACADVersionDouble &amp;lt;= 19.1)
{
     acedCmd(m_ResultBuffer.UnmanagedObject);
}&lt;/PRE&gt;&lt;P&gt;This works fine in a command, you don't have to wait or something like that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards Jürgen&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 22:11:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7676953#M28214</guid>
      <dc:creator>Juergen_Becker</dc:creator>
      <dc:date>2018-01-09T22:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677287#M28215</link>
      <description>&lt;P&gt;There is no need to call directly to acedCmd() or acedCmdS() because they are called by the Editor.Command() method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Editor.Command() method is a managed wrapper for acedCmdS():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the source code of Editor.Command():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Autodesk.AutoCAD.EditorInput.Editor
public unsafe void Command(params object[] parameter)
{
   resbuf* ptr = null;
   try
   {
      ptr = (resbuf*)Marshaler.ObjectsToResbuf(parameter).ToPointer();
      Interop.CheckAds(&amp;lt;Module&amp;gt;.&lt;FONT color="#FF0000"&gt;acedCmdS&lt;/FONT&gt;((resbuf*)ptr, false, null));
   }
   finally
   {
      if (ptr != null)
      {
         &amp;lt;Module&amp;gt;.acutRelRb(ptr);
      }
   }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2144608"&gt;@Juergen_Becker&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a DLLImport to define a method which calls internals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[DllImport("accore.dll",
 CharSet = CharSet.Unicode,
 CallingConvention = CallingConvention.Cdecl,
 EntryPoint = "acedCmd")]
public static extern int acedCmd(IntPtr vlist);

[DllImport("accore.dll",
 CharSet = CharSet.Unicode,
 CallingConvention = CallingConvention.Cdecl,
 EntryPoint = "acedCmdS")]
public static extern int acedCmdS(System.IntPtr vlist);&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;This is an example:&lt;/P&gt;&lt;PRE&gt;m_ResultBuffer = new ResultBuffer();
m_ResultBuffer.Add(new TypedValue(5005, "_.SAVEAS"));
m_ResultBuffer.Add(new TypedValue(5005, m_ResultBuffer.Add(new TypedValue(5005, m_FileName));

if (System.IO.File.Exists(m_FileName) == true)
{
     m_ResultBuffer.Add(new TypedValue(5005, "_YES"));
}
if (m_ACADVersionDouble &amp;gt;= 21)
{
     acedCmdS(m_ResultBuffer.UnmanagedObject);
}
else if (m_ACADVersionDouble &amp;gt;= 19 &amp;amp;&amp;amp; m_ACADVersionDouble &amp;lt;= 19.1)
{
     acedCmd(m_ResultBuffer.UnmanagedObject);
}&lt;/PRE&gt;&lt;P&gt;This works fine in a command, you don't have to wait or something like that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards Jürgen&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 01:26:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677287#M28215</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2018-01-10T01:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677435#M28216</link>
      <description>&lt;P&gt;thank you for your reply!&lt;/P&gt;&lt;P&gt;i simply my processing,i open template ,then &amp;nbsp;add a &amp;nbsp;circle &amp;nbsp;,then &amp;nbsp;save &amp;nbsp;and close, one by one&amp;nbsp;&lt;/P&gt;&lt;P&gt;my code like &amp;nbsp;this,but is run &amp;nbsp;wrong&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to modify ?&lt;/P&gt;&lt;PRE&gt;        [CommandMethod("MyOF")]
        public void op()
        {
            string filedia = Application.GetSystemVariable("filedia").ToString();
            DocumentCollection docsMgr = Application.DocumentManager;
            for (int i = 0; i &amp;lt; 100; i++)
            {
                try
                {
                    Document doc = docsMgr.Open("C:\\template2000.dwg", false);
                    docsMgr.MdiActiveDocument = doc;
                    using (doc.LockDocument())
                    {
                        ObjectId entityID;
                        using (var tr = doc.TransactionManager.StartTransaction())
                        {
                            var modelspace = (BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(doc.Database), OpenMode.ForWrite);
                            Circle circ = new Circle(Point3d.Origin, Vector3d.ZAxis, 100.0);
                            entityID = modelspace.AppendEntity(circ);

                            tr.AddNewlyCreatedDBObject(circ, true);
                            tr.Commit();
                            doc.UserData.Add("EntityId", entityID);

                        }
                      
                        doc.Editor.Command("_.ZOOM", "_object", doc.UserData["EntityId"], "");

                        doc.Editor.Command("_.SAVEAS", "2004", "C:\\ee" + i + ".dwg", "Y");


                       
                    }

               
                   doc.Editor.Command("_.CLOSE");

                }
                catch (System.Exception ee)
                {
                    Util.PrintLn("error" + ee.Message.ToString());
                }


            }

        }&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 03:21:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677435#M28216</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T03:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677837#M28217</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To be able to switch between documents, you have to use the CommandFlags.Session, but this sets your command in the application context and you can only use Editor.Command() in the document context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For batch scripting files, you should have a look at &lt;A href="https://github.com/ADN-DevTech/ScriptPro" target="_blank"&gt;ScriptPro&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:02:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677837#M28217</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T08:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677864#M28218</link>
      <description>&lt;P&gt;thank you for your reply!&lt;/P&gt;&lt;P&gt;I know if i use the &amp;nbsp;commandflag.session , ed.command &amp;nbsp;does't work.&lt;/P&gt;&lt;P&gt;how do i send command&amp;nbsp;synchronous in commandflag.session, &amp;nbsp;so that &amp;nbsp;i can &amp;nbsp;operate &amp;nbsp;dwg &amp;nbsp;one by one!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:13:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677864#M28218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T08:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677904#M28219</link>
      <description>&lt;P&gt;can you give me &amp;nbsp;a &amp;nbsp;whole example code?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:29:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677904#M28219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T08:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677948#M28220</link>
      <description>&lt;P&gt;As far as I know there's no way to synchronously call commands in application context, but I may be wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:49:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677948#M28220</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T08:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677973#M28221</link>
      <description>&lt;P&gt;is there no way &amp;nbsp;to solve my problem?&lt;/P&gt;&lt;P&gt;I just &amp;nbsp;want &amp;nbsp;to &amp;nbsp;do&amp;nbsp; that &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;open a &amp;nbsp;template dwg file &amp;nbsp;,then &amp;nbsp;send a &amp;nbsp;command &amp;nbsp;to &amp;nbsp;add a &amp;nbsp;circle &amp;nbsp;,then &amp;nbsp;save &amp;nbsp;and close, one by one&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:57:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7677973#M28221</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T08:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678008#M28222</link>
      <description>&lt;P&gt;&amp;nbsp;and save the Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why do you open the drawin ginto the editor? Thats Needs time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What about this?&lt;/P&gt;&lt;PRE&gt;m_DataBase = new Database(false, true);
m_DataBase.ReadDwgFile(m_DrawingPath + @"\" + m_Name + ".DWG",
      System.IO.FileShare.Read,
      true,
      string.Empty);
m_DataBase.CloseInput(true);&lt;/PRE&gt;&lt;P&gt;This does'nt open the drawing in the Editor and it's much faster. After that you can add your circle or what ever you want and save the drawing.&lt;/P&gt;&lt;P&gt;m_Name is the drawing Name put your drawing Name into a list (System.Collections.Generic.List&amp;lt;string&amp;gt;).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW: You don't need any SendCommands or what ever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;yanasdf789 wrote:&lt;/P&gt;&lt;P&gt;is there no way &amp;nbsp;to solve my problem?&lt;/P&gt;&lt;P&gt;I just &amp;nbsp;want &amp;nbsp;to &amp;nbsp;do&amp;nbsp; that &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;open a &amp;nbsp;template dwg file &amp;nbsp;,then &amp;nbsp;send a &amp;nbsp;command &amp;nbsp;to &amp;nbsp;add a &amp;nbsp;circle &amp;nbsp;,then &amp;nbsp;save &amp;nbsp;and close, one by one&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Regards Jürgen&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:13:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678008#M28222</guid>
      <dc:creator>Juergen_Becker</dc:creator>
      <dc:date>2018-01-10T09:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678022#M28223</link>
      <description>&lt;P&gt;i have try this &amp;nbsp;method,&lt;/P&gt;&lt;P&gt;the problem is that &amp;nbsp;i have thousands of &amp;nbsp;dwg &amp;nbsp;file to do ,the &amp;nbsp;memory &amp;nbsp;of &amp;nbsp;ACAD.EXE &amp;nbsp; will &amp;nbsp;increase &amp;nbsp;quickly!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to &amp;nbsp;free &amp;nbsp;the memory &amp;nbsp;when database close?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:20:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678022#M28223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T09:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678031#M28224</link>
      <description>&lt;P&gt;If you only want to draw a circle (or anything else which can be done by a command), you can use SendStringtoExecute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        [CommandMethod("MyOF", CommandFlags.Session)]
        public void op()
        {
            string filedia = Application.GetSystemVariable("FILEDIA").ToString();
            DocumentCollection docsMgr = Application.DocumentManager;
            for (int i = 0; i &amp;lt; 100; i++)
            {
                try
                {
                    Document doc = docsMgr.Open("C:\\template2000.dwg", false);
                    docsMgr.MdiActiveDocument = doc;
                    string filename = "C:\\ee" + i + ".dwg";
                    if (System.IO.File.Exists(filename))
                        System.IO.File.Delete(filename);
                    doc.SendStringToExecute("FILEDIA 0 ", false, false, false);
                    doc.SendStringToExecute("_.CIRCLE 0,0 100.0 ", false, false, false);
                    doc.SendStringToExecute("_.ZOOM _object _last  ", false, false, false);
                    doc.SendStringToExecute("_.SAVEAS 2004 " + filename + "\n", false, false, false);
                    doc.SendStringToExecute("_.CLOSE ", false, false, false);
                    doc.SendStringToExecute("FILEDIA " + filedia + " ", false, false, false);
                }
                catch (System.Exception ee)
                {
                    Util.PrintLn("error" + ee.Message.ToString());
                }
            }
        }&lt;/PRE&gt;
&lt;P&gt;But, IMO, for this kind of scripting, you should have a look at the accoreconsole.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:22:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678031#M28224</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T09:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678037#M28225</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;i have try this &amp;nbsp;method,&lt;/P&gt;
&lt;P&gt;the problem is that &amp;nbsp;i have thousands of &amp;nbsp;dwg &amp;nbsp;file to do ,the &amp;nbsp;memory &amp;nbsp;of &amp;nbsp;ACAD.EXE &amp;nbsp; will &amp;nbsp;increase &amp;nbsp;quickly!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to &amp;nbsp;free &amp;nbsp;the memory &amp;nbsp;when database close?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt; said, if you have thousands of files to do, you should stop and restart AutoCAD from time to time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to me that ScriptPro handles this.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:25:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678037#M28225</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T09:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678113#M28226</link>
      <description>&lt;P&gt;What I don't understand is that you necessarily loaded the document into the Editor.&amp;nbsp;&lt;/P&gt;&lt;DIV class="g-section"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="g-unit"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;It is not necessary for such a task.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;Use ReadDwgFile to open the darwing into the Memory. Close the Input. Do what you want with the drawing database, save it and Close the drawing.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;I did that with 6000 drawings without any problems.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;You can use AutoCAD to that or mentionied above with the AutoCAD Core Console and forget all the SendCommands.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Jan 2018 09:58:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678113#M28226</guid>
      <dc:creator>Juergen_Becker</dc:creator>
      <dc:date>2018-01-10T09:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678225#M28227</link>
      <description>&lt;P&gt;Here's a simple Console Application which uses the Core Console.&lt;/P&gt;
&lt;P&gt;Change the core console path as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

namespace AcCoreConsoleSample
{
    class Program
    {
        static void Main(string[] args)
        {
            Run();
        }

        const string coreConsolePath = @"C:\Program Files\Autodesk\AutoCAD 2013\accoreconsole.exe";
        cons string scriptPath = @"C:\Temp\CoreConsoleScript.scr";&lt;BR /&gt;
        static void Run()
        {
            for (int i = 0; i &amp;lt; 10; i++)
            {
                string filename = "C:\\Temp\\ee" + i + ".dwg";
                if (File.Exists(filename))
                    File.Delete(filename);
                using (var writer = new StreamWriter(scriptPath, false))
                {
                    writer.WriteLine("_.CIRCLE 0,0 100.0");
                    writer.WriteLine("_.ZOOM _object _last\n");
                    writer.WriteLine("_.SAVEAS 2004");
                    writer.WriteLine(filename);
                }
                string args = "/s " + scriptPath;
                var startInfo = new ProcessStartInfo(coreConsolePath, args);
                startInfo.WindowStyle = ProcessWindowStyle.Normal;
                var process = Process.Start(startInfo);
                process.WaitForExit();
            }
            File.Delete(scriptPath);
        }
    }
}&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 10:49:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678225#M28227</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T10:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678233#M28228</link>
      <description>&lt;P&gt;Y&lt;SPAN class=""&gt;ou can also easily parallelize the process to run in parallel as many consoles as available cores.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;

namespace AcCoreConsoleSample
{
    class Program
    {
        static void Main(string[] args)
        {
            RunParallel();
        }

        const string coreConsolePath = @"C:\Program Files\Autodesk\AutoCAD 2013\accoreconsole.exe";

        static void RunParallel()
        {
            Parallel.For(0, 10, i =&amp;gt;
            {
                string filename = "C:\\Temp\\ee" + i + ".dwg";
                if (File.Exists(filename))
                    File.Delete(filename);
                string scriptPath = @"C:\Temp\CoreConsoleScript_" + i + ".scr";
                using (var writer = new StreamWriter(scriptPath, false))
                {
                    writer.WriteLine("_.CIRCLE 0,0 100.0");
                    writer.WriteLine("_.ZOOM _object _last\n");
                    writer.WriteLine("_.SAVEAS 2004");
                    writer.WriteLine(filename);
                }
                string args = "/s " + scriptPath;
                var startInfo = new ProcessStartInfo(coreConsolePath, args);
                startInfo.WindowStyle = ProcessWindowStyle.Normal;
                var process = Process.Start(startInfo);
                process.WaitForExit();
                File.Delete(scriptPath);
            });
        }
    }
}
&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 10:54:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678233#M28228</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T10:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678247#M28229</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2144608"&gt;@Juergen_Becker&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;What I don't understand is that you necessarily loaded the document into the Editor. &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because the OP wants to be able to run commands (he talked about the MAPTRIM command in the first post).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 10:58:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678247#M28229</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-01-10T10:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678293#M28230</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2144608"&gt;@Juergen_Becker&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;What I don't understand is that you necessarily loaded the document into the Editor.&amp;nbsp;&lt;/P&gt;&lt;DIV class="g-section"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="g-unit"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;It is not necessary for such a task.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;Use ReadDwgFile .....&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The ZOOM command cannot be used on a drawing that's not open in the Editor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at the code again. Do you see&amp;nbsp;&lt;STRONG&gt;"Command("._ZOOM, ...)&lt;/STRONG&gt; ????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are going to make such statements, then you should also show&amp;nbsp;how to&lt;STRONG&gt; zoom to an object&lt;/STRONG&gt; in a drawing that's not open in the editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While it's not impossible, it's not so simple a task, so before you tell others to use ReadDwgFile(), you have to show them how to do the task that you say doesn't require the drawing to be open in the editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So please show the OP how to zoom to an object without opening the drawing in the editor, and while you're at it, also show how to generate a correct thumbnail preview for the DWG file without opening it in the editor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 11:23:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7678293#M28230</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2018-01-10T11:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: SendCommand  with error "Unhandled Access violation Reading 0xfffffffff</title>
      <link>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7680879#M28231</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;you said "&lt;SPAN&gt;Use ReadDwgFile to open the darwing into the Memory.... did that with 6000 drawings without any problems.",&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if &amp;nbsp;you &amp;nbsp;read &amp;nbsp;6000 drawings &amp;nbsp;into &amp;nbsp;memory , how &amp;nbsp;large &amp;nbsp; &amp;nbsp;memory &amp;nbsp;occupy with &amp;nbsp;acad.exe &amp;nbsp;at last &amp;nbsp;?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;do &amp;nbsp;you done &amp;nbsp;some thing to &amp;nbsp;free &amp;nbsp;memory?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can you &amp;nbsp;solve the &amp;nbsp;problem &amp;nbsp;in&amp;nbsp; &amp;nbsp;another topic?&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/net/database-free-the-memory/m-p/7623187#M56334" target="_blank"&gt;https://forums.autodesk.com/t5/net/database-free-the-memory/m-p/7623187#M56334&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 01:35:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/sendcommand-with-error-quot-unhandled-access-violation-reading/m-p/7680879#M28231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-11T01:35:33Z</dc:date>
    </item>
  </channel>
</rss>

