<?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 eInvalidInput error in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893568#M26493</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Line line = new Line(ptStart, ptEnd);
Vector3d vec = new Vector3d();
Point3d ptd1 = new Point3d();
vec = line.GetFirstDerivative(ptd1).GetNormal(); //&lt;SPAN&gt;eInvalidInput&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ptStart coordinate is&amp;nbsp;(655275600.438987,36192616.8036762,0)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ptEnd coordinate is&amp;nbsp;&lt;/SPAN&gt;(655295053.399808,36189883.0214896,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why am I always getting "eInvalidInput" error. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2018 10:15:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-29T10:15:05Z</dc:date>
    <item>
      <title>eInvalidInput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893568#M26493</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Line line = new Line(ptStart, ptEnd);
Vector3d vec = new Vector3d();
Point3d ptd1 = new Point3d();
vec = line.GetFirstDerivative(ptd1).GetNormal(); //&lt;SPAN&gt;eInvalidInput&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ptStart coordinate is&amp;nbsp;(655275600.438987,36192616.8036762,0)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ptEnd coordinate is&amp;nbsp;&lt;/SPAN&gt;(655295053.399808,36189883.0214896,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why am I always getting "eInvalidInput" error. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:15:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893568#M26493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-29T10:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: eInvalidInput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893763#M26494</link>
      <description>&lt;PRE&gt; [CommandMethod("testDerivative")]
        public static void TestLine()
        {
            //// Your start points
            // Point3d p1 = new Point3d(655275600.438987, 36192616.8036762, 0);
            // Point3d p2 = new Point3d(655295053.399808, 36189883.0214896, 0);

            Point3d p1 = new Point3d(0, 0, 0);
            Point3d p2 = new Point3d(10, 0, 0);
            Point3d p3 = new Point3d(5, 0, 0);            

            using (Line ln = new Line(p1, p2))
            {
                Vector3d vec = new Vector3d();
                vec = ln.GetFirstDerivative(p3).GetNormal(); 
            }
        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Try the above code - it works for me.&lt;/LI&gt;&lt;LI&gt;I think the error is coming because the p3 (i.e. the point supplied to the GetFirstDerivative method is not on the line itself.&amp;nbsp;&lt;STRONG&gt;Solution is to&lt;/STRONG&gt;: supply a point on the line.&lt;/LI&gt;&lt;LI&gt;Also I think you should dispose of your Line explicitly or use a `using` statement..&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 29 Mar 2018 11:23:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893763#M26494</guid>
      <dc:creator>BKSpurgeon</dc:creator>
      <dc:date>2018-03-29T11:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: eInvalidInput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893839#M26495</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's because ptd1 (initialized to 0,0,0) does not lies on the line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get the direction vector of the line, you can simply do:&lt;/P&gt;
&lt;PRE&gt;vec = ptStart.GetVectorTo(ptEnd).GetNormal();&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;or:&lt;/P&gt;
&lt;PRE&gt;vec = (ptEnd - ptStart).GetNormal()&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 12:00:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-error/m-p/7893839#M26495</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2018-03-29T12:00:27Z</dc:date>
    </item>
  </channel>
</rss>

