<?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 Help with GetNormalAtPoint in C# needed (VB.Net - OK) in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239252#M35852</link>
    <description>&lt;P&gt;I'm trying to convert my VB.Net project to C# (some employers prefer C#) and I feel a bit confused with usage of GetNormalAtPoint method (on the same dataset it fails to return same result as VB.Net does).&lt;/P&gt;&lt;P&gt;VB.Net code (piece of interest):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Call oFrF.Evaluator.GetNormalAtPoint(pt, n)

MessageBox.Show("oFrF.TransientKey = " &amp;amp; oFrF.TransientKey &amp;amp; vbCrLf &amp;amp; "pt : " &amp;amp; pt(0) &amp;amp; "  ;  " &amp;amp; pt(1) &amp;amp; "  ;  " &amp;amp; pt(2) &amp;amp; vbCrLf &amp;amp; "n : " &amp;amp; n(0) &amp;amp; "  ;  " &amp;amp; n(1) &amp;amp; "  ;  " &amp;amp; n(2), "VB")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C#:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;oFrF.Evaluator.GetNormalAtPoint(pt, n);

MessageBox.Show ("oFrF.TransientKey = " + oFrF.TransientKey + System.Environment.NewLine + "pt : " + pt[0] + "  ;  " + pt[1] + "  ;  " + pt[2] + System.Environment.NewLine + "n : " + n[0] + "  ;  " + n[1] + "  ;  " + n[2],"C#");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm expecting to get the same coordinates of n (Point) on same "oFrF" (Face) and "pt" (Point) but I get zero:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="C#-GetNormalAtPoint-Issue (vs VB).jpg" style="width: 430px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1080725iC102A5E6E9E177FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="C#-GetNormalAtPoint-Issue (vs VB).jpg" alt="C#-GetNormalAtPoint-Issue (vs VB).jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I'm missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2022 11:35:17 GMT</pubDate>
    <dc:creator>Maxim-CADman77</dc:creator>
    <dc:date>2022-06-16T11:35:17Z</dc:date>
    <item>
      <title>Help with GetNormalAtPoint in C# needed (VB.Net - OK)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239252#M35852</link>
      <description>&lt;P&gt;I'm trying to convert my VB.Net project to C# (some employers prefer C#) and I feel a bit confused with usage of GetNormalAtPoint method (on the same dataset it fails to return same result as VB.Net does).&lt;/P&gt;&lt;P&gt;VB.Net code (piece of interest):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Call oFrF.Evaluator.GetNormalAtPoint(pt, n)

MessageBox.Show("oFrF.TransientKey = " &amp;amp; oFrF.TransientKey &amp;amp; vbCrLf &amp;amp; "pt : " &amp;amp; pt(0) &amp;amp; "  ;  " &amp;amp; pt(1) &amp;amp; "  ;  " &amp;amp; pt(2) &amp;amp; vbCrLf &amp;amp; "n : " &amp;amp; n(0) &amp;amp; "  ;  " &amp;amp; n(1) &amp;amp; "  ;  " &amp;amp; n(2), "VB")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C#:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;oFrF.Evaluator.GetNormalAtPoint(pt, n);

MessageBox.Show ("oFrF.TransientKey = " + oFrF.TransientKey + System.Environment.NewLine + "pt : " + pt[0] + "  ;  " + pt[1] + "  ;  " + pt[2] + System.Environment.NewLine + "n : " + n[0] + "  ;  " + n[1] + "  ;  " + n[2],"C#");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm expecting to get the same coordinates of n (Point) on same "oFrF" (Face) and "pt" (Point) but I get zero:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="C#-GetNormalAtPoint-Issue (vs VB).jpg" style="width: 430px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1080725iC102A5E6E9E177FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="C#-GetNormalAtPoint-Issue (vs VB).jpg" alt="C#-GetNormalAtPoint-Issue (vs VB).jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I'm missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 11:35:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239252#M35852</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2022-06-16T11:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with GetNormalAtPoint in C# needed (VB.Net - OK)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239349#M35853</link>
      <description>&lt;P&gt;You miss the 'ref' keyword in method calls&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var part = ThisDoc.Document as PartDocument;
var face = part.ComponentDefinition.SurfaceBodies[1].Faces[1];

var pointOnFace = face.PointOnFace;
double[] point = { };
pointOnFace.GetPointData(ref point);

double[] normal = {};
face.Evaluator.GetNormalAtPoint(ref point,  ref normal);

MessageBox.Show(string.Join(";", normal));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 12:15:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239349#M35853</guid>
      <dc:creator>Michael.Navara</dc:creator>
      <dc:date>2022-06-16T12:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with GetNormalAtPoint in C# needed (VB.Net - OK)</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239925#M35854</link>
      <description>&lt;P&gt;Yes, correct C#-code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oFrF.Evaluator.GetNormalAtPoint(ref pt, ref n)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... seems a bit strange that Visual Studio* IntelliCode does not detect an issue if no keyword is used ... while&amp;nbsp;it gives correct hint if the wrong keyword (ex. 'out') is used:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-06-16 183407.jpg" style="width: 716px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1080872i911DEF283286737F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-06-16 183407.jpg" alt="Screenshot 2022-06-16 183407.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you so much!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* I'm using VS&amp;nbsp;Community 2019 version 16.11.16&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 15:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/help-with-getnormalatpoint-in-c-needed-vb-net-ok/m-p/11239925#M35854</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2022-06-16T15:39:11Z</dc:date>
    </item>
  </channel>
</rss>

