<?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 face.Evaluate() returns wrong result on angled Face in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/face-evaluate-returns-wrong-result-on-angled-face/m-p/11715073#M14187</link>
    <description>&lt;P&gt;Hello, I recently ran into an issue creating families on a face where I don’t understand what’s going on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to place families in a grid onto a surface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, four instances at UV(10,10), UV(20,20), UV(30,30), UV(40,40)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;_uv = new UV(10, 10);

location = face.Evaluate(_uv);

Document.Create.NewFamilyInstance(_reference,location  , new XYZ(0, 0, 0), _symbol);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works like i would expect.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FlachmitPaneln.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168863iDEEA6A4FB9564864/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FlachmitPaneln.PNG" alt="FlachmitPaneln.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when my Face is angled like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schräg.PNG" style="width: 372px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168864iF5DD06A0235DA798/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Schräg.PNG" alt="Schräg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the panels will be placed like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SchrägmitPanel.PNG" style="width: 577px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168865i5058A2C49889A952/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SchrägmitPanel.PNG" alt="SchrägmitPanel.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;The face evaluation returns XYZ Positions that aren’t on the face anymore. Even the origin changes.&lt;BR /&gt;Why does Revit calculate it like this? And how do I have to evaluate the correct XYZ on the angled Face, so I can create my families?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 08:48:12 GMT</pubDate>
    <dc:creator>florian.schaeferTJTBZ</dc:creator>
    <dc:date>2023-01-30T08:48:12Z</dc:date>
    <item>
      <title>face.Evaluate() returns wrong result on angled Face</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/face-evaluate-returns-wrong-result-on-angled-face/m-p/11715073#M14187</link>
      <description>&lt;P&gt;Hello, I recently ran into an issue creating families on a face where I don’t understand what’s going on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to place families in a grid onto a surface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, four instances at UV(10,10), UV(20,20), UV(30,30), UV(40,40)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;_uv = new UV(10, 10);

location = face.Evaluate(_uv);

Document.Create.NewFamilyInstance(_reference,location  , new XYZ(0, 0, 0), _symbol);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works like i would expect.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FlachmitPaneln.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168863iDEEA6A4FB9564864/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FlachmitPaneln.PNG" alt="FlachmitPaneln.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when my Face is angled like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schräg.PNG" style="width: 372px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168864iF5DD06A0235DA798/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Schräg.PNG" alt="Schräg.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the panels will be placed like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SchrägmitPanel.PNG" style="width: 577px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1168865i5058A2C49889A952/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SchrägmitPanel.PNG" alt="SchrägmitPanel.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;The face evaluation returns XYZ Positions that aren’t on the face anymore. Even the origin changes.&lt;BR /&gt;Why does Revit calculate it like this? And how do I have to evaluate the correct XYZ on the angled Face, so I can create my families?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 08:48:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/face-evaluate-returns-wrong-result-on-angled-face/m-p/11715073#M14187</guid>
      <dc:creator>florian.schaeferTJTBZ</dc:creator>
      <dc:date>2023-01-30T08:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: face.Evaluate() returns wrong result on angled Face</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/face-evaluate-returns-wrong-result-on-angled-face/m-p/11715101#M14188</link>
      <description>&lt;P&gt;Ours is not to reason why; ours is but to do or die...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Why&lt;/U&gt;&amp;nbsp;Revit does this is not really helpful to know (we'll provide a hint below anyway).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be &lt;U&gt;handled&lt;/U&gt;? Now there is a useful question. In the distant past, Scott Conover explained the basics of the Revit geometry library, including face parametrisation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/01/faces.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2010/01/faces.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can &lt;U&gt;never&lt;/U&gt; rely on the origin being in any specific location on a face. It depends on how the face was created. If the face is part of an element E, and you intersect E with another element F and subtract or join or otherwise modify the geometry, you might end up with new faces that have seemingly arbitrarily positioned origins.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, when you meet a new face, you need to query it for its parametrisation. Where is your origin? Which direction are your U and V vectors pointing? How is you U and V scaling defined? Once you have determined all those factors, you can start calculating UV points and correlating them with real-world XYZ 3D locations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 09:02:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/face-evaluate-returns-wrong-result-on-angled-face/m-p/11715101#M14188</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-01-30T09:02:01Z</dc:date>
    </item>
  </channel>
</rss>

