<?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 : editor.Command in 2015 einvalidinput error in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502048#M41390</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Editor.Command() method requires arguments of the same type used in LISP (int, double, Point3d, ...), so, for the "tilemode" command, you have to pass an integer:&lt;/P&gt;
&lt;PRE&gt;ed.Command("tilemeode", 1);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I think it's a better practice to avoid calling commands when it's possible. In this case, it's quite easy using the DatabaseTileMode property:&lt;/P&gt;
&lt;PRE&gt;if (!db.TileMode)
    db.TileMode = true;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Feb 2015 17:42:39 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2015-02-10T17:42:39Z</dc:date>
    <item>
      <title>editor.Command in 2015 einvalidinput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5501489#M41389</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I.m trying to convert my 2012 code to 2015, but I'm having problems with a part of my code where I want to switch to modelspace. In 2012 I used&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ed.Command("_.TILEMODE", "1");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This works as expected. But in 2015 this gives an 'einvalidinput' exception. After reading the ObjectArx 2015 documentation I changed that line to:&lt;/P&gt;&lt;PRE&gt;ed.Command(new Object[] { "_.TILEMODE", "1" });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;but that still gives an&amp;nbsp;&lt;SPAN&gt;'einvalidinput' exception.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also tried&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("TILEMODE", 1);
 
oDoc.SendStringToExecute("_.TILEMODE 1 ", true, false, false);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;but both seem to do nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the entire code which is called from an UserControl within a paletteset:&lt;/P&gt;&lt;PRE&gt;private void exportbutton_Click(object sender, EventArgs e)
{
    string dwgFileName = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("DWGNAME") as string;
    string dwgPath = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("DWGPREFIX") as string;

    string tmp = "TBX_" + dwgFileName.Remove(dwgFileName.Length - 4);

    SaveFileDialog saveFileDialog1 = new SaveFileDialog();
    saveFileDialog1.FileName = tmp;
    saveFileDialog1.InitialDirectory = dwgPath;
    saveFileDialog1.RestoreDirectory = true;
    saveFileDialog1.Filter = "Autocad dwg(*.dwg)|*.dwg";
    DialogResult result1 = saveFileDialog1.ShowDialog();

    if (result1 == DialogResult.OK)
    {
        try
        {
            Database db = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
            db.SaveAs(saveFileDialog1.FileName, DwgVersion.Current);

            Document oDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(saveFileDialog1.FileName, false);
            var ed = oDoc.Editor;
                    

            string bordlaag = "";

            BordnrClass bnc = new BordnrClass();
            bordlaag = bnc.bordlaag();

            if (bordlaag == "")
            {
                bordlaag = "tekstborden";
            }

            TSNedTool.clsTSNed tscl = new TSNedTool.clsTSNed();

            using (Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument())
            {
                corelExportClass cec = new corelExportClass();
                cec.export_to_corel();

                UnlockLayersClass ul = new UnlockLayersClass();
                ul.UnlockAllLayers();

                BordColorClass bcc = new BordColorClass();
                bcc.Change_bord_color();

                SorteerBordenClass srtbrd = new SorteerBordenClass();
                srtbrd.SorteerBorden();

                tscl.ReScaleBorden();
                tscl.RotateBorden();
                tscl.LayersOnUnlockUnfrozen();
                tscl.CleanUpEverythingExceptBorden(bordlaag);

                tscl.CleanUpVisibility();
                tscl.LayersVerwijderen();
                //tscl.PurgeAll();

                //PurgeAll pg = new PurgeAll();
                //while (pg.purgeAll(db, false))
                //    continue;                        

                if (LayoutManager.Current.CurrentLayout != "Model")
                {
                    ed.Command("_.TILEMODE", "1");                            
                    //Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("TILEMODE", 1);
                    //ed.Command(new Object[] { "_.TILEMODE", "1" });  
                    //oDoc.SendStringToExecute("_.TILEMODE 1 ", true, false, false);
                }
                ed.Command("_.ZOOM", "EXTENTS");
                //ed.Command(new Object[] { "_.ZOOM", "EXTENTS" });                        
                //oDoc.SendStringToExecute("_.ZOOM EXTENTS ", true, false, false);

                oDoc.Editor.Regen();                        
            }
            oDoc.CloseAndSave(oDoc.Name);
            Autodesk.AutoCAD.ApplicationServices.Application.UpdateScreen();
        }
        catch(Autodesk.AutoCAD.Runtime.Exception ex)
        {
            MessageBox.Show("Fout bij exporteren naar Coreldraw bestand!", "Export error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I using editor.command incorrectly, or is there something else I'm missing?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 11:54:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5501489#M41389</guid>
      <dc:creator>marcwalen</dc:creator>
      <dc:date>2015-02-10T11:54:15Z</dc:date>
    </item>
    <item>
      <title>Re : editor.Command in 2015 einvalidinput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502048#M41390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Editor.Command() method requires arguments of the same type used in LISP (int, double, Point3d, ...), so, for the "tilemode" command, you have to pass an integer:&lt;/P&gt;
&lt;PRE&gt;ed.Command("tilemeode", 1);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I think it's a better practice to avoid calling commands when it's possible. In this case, it's quite easy using the DatabaseTileMode property:&lt;/P&gt;
&lt;PRE&gt;if (!db.TileMode)
    db.TileMode = true;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 17:42:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502048#M41390</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-02-10T17:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: editor.Command in 2015 einvalidinput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502053#M41391</link>
      <description>i'll guess you're running into a bug.&lt;BR /&gt;Did you tried to only switch from paper to model, without other actions and the dialogs?&lt;BR /&gt;Some more tests you can do but i'm pretty sure it will make no difference.&lt;BR /&gt;//Goto Modelspace: Modelspace: Setvar.Tilemode=1&lt;BR /&gt;if (!db.TileMode)&lt;BR /&gt;db.TileMode=true;&lt;BR /&gt;&lt;BR /&gt;Application..SetSystemVariable("CTAB", "Model");&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Feb 2015 17:44:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502053#M41391</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-02-10T17:44:57Z</dc:date>
    </item>
    <item>
      <title>Re : editor.Command in 2015 einvalidinput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502327#M41392</link>
      <description>&lt;P&gt;Changing&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ed.Command("TILEMODE", "1");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;to&lt;/P&gt;&lt;PRE&gt;ed.Command("TILEMODE", 1);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;didn't make any difference, stil eInvalidInput exception. But using&lt;/P&gt;&lt;PRE&gt;if (!db.TileMode)
{
    db.TileMode = true;
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;works, so thank you for that, I didn't know about this possibility. Now all that remains is the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ed.Command("ZOOM", "EXTENTS");
ed.Command(new Object[] { "_.ZOOM", "EXTENTS" });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;part. Both of these still give an eInvalidInput exception. Is there any other way to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 20:54:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502327#M41392</guid>
      <dc:creator>marcwalen</dc:creator>
      <dc:date>2015-02-10T20:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: editor.Command in 2015 einvalidinput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502333#M41393</link>
      <description>Yes, its only switching to modelspace and then Zoom Extents. The only dialog is the SaveAs dialog at the start of the class.</description>
      <pubDate>Tue, 10 Feb 2015 20:58:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502333#M41393</guid>
      <dc:creator>marcwalen</dc:creator>
      <dc:date>2015-02-10T20:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: editor.Command in 2015 einvalidinput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502506#M41394</link>
      <description>&lt;P&gt;For a zoom extents without calling the command, you can have a look to &lt;A href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer%27s%20Guide/index.html?url=WS1a9193826455f5ff2566ffd511ff6f8c7ca-4363.htm,topicNumber=d0e5006" target="_blank"&gt;this code&lt;/A&gt; provided in the AutoCAD .NET Developer's Guide or these &lt;A href="http://www.theswamp.org/index.php?topic=46442.msg514605#msg514605" target="_blank"&gt;little extension methods&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 23:06:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/editor-command-in-2015-einvalidinput-error/m-p/5502506#M41394</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-02-10T23:06:00Z</dc:date>
    </item>
  </channel>
</rss>

