<?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: Incorrect face normal in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111300#M58182</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; MessageBox.Show($"computedFaceNormal: {computedFaceNormal.ToString()}, faceNormal: {faceNormal.ToString()}, Area: {selectedFace.Area.ToString()}");&lt;/PRE&gt;&lt;P&gt;I tested it again. The area are correct, but the face normal...&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360584i614BF02FAA3E16A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2017 14:01:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-05-26T14:01:20Z</dc:date>
    <item>
      <title>Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7108787#M58174</link>
      <description>&lt;P&gt;I created two beams &lt;SPAN&gt;through&lt;/SPAN&gt;&amp;nbsp;different&amp;nbsp;&lt;SPAN&gt;codes. Their&amp;nbsp;FamilySymbols are the same. But their left faces' (marked as red in pic)normal are different! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The face normal of the left beam is the same as I expected(-1,0,0).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The face normal of the right&amp;nbsp;beam is wriong to me and I don't konw why.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360120iEE7F73EAA7CAD267/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Attached is my project for your erfernce.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 13:52:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7108787#M58174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-25T13:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7108838#M58175</link>
      <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;It seems that one beam is bound to 标高2 as working plane, and the other one is unbound. Is this intended? This binding can influence the position of the FamilyInstance in WCS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 14:09:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7108838#M58175</guid>
      <dc:creator>dragos.turmac</dc:creator>
      <dc:date>2017-05-25T14:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7108905#M58176</link>
      <description>&lt;P&gt;Hi&amp;nbsp;dragos.turmac, Thanks for your quick response!&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bounding to a&amp;nbsp;working plane is not my intention. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For the both beams I used Instance = Doc.Create.NewFamilyInstance(line, FamilySymbol, Level, StructuralType.Beam) to create them.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can i&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;avoid bounding to a&amp;nbsp;working plane when creaing? Why and how&amp;nbsp;working plane&amp;nbsp;influence the FamilyInstance? If I can't change the way of creating the right beam how can i get the correct face normal like the left beam? Thanks!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 14:30:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7108905#M58176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-25T14:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7109074#M58177</link>
      <description>&lt;P&gt;You can try passing null for Level. Unfortunately it's not explicitly mentioned in the documentation, but the Level parameter is optional.&lt;/P&gt;
&lt;P&gt;The beam, after all, it is a family; like every family, it has a local coordinate system. If you bind it to a plane, than it's LCS is might no longer be identical to WCS; it's local Z axis will correspond to the Z axis of the reference plane.&lt;/P&gt;
&lt;P&gt;What you are seeing is the beam's face normal in LCS, that's why they differ even if they point in the same WCS direction.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 15:41:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7109074#M58177</guid>
      <dc:creator>dragos.turmac</dc:creator>
      <dc:date>2017-05-25T15:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7110557#M58178</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the RevitAPI.chm it says:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PlanarFace.FaceNormal property&lt;BR /&gt;This property is the "face normal" vector, and thus &lt;U&gt;&lt;STRONG&gt;should&lt;/STRONG&gt; &lt;/U&gt;return a vector consistently pointing out of the solid that this face is a boundary for (if it is a part of a solid). &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also this method:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Face.ComputeNormal()&lt;BR /&gt;It will &lt;U&gt;&lt;STRONG&gt;always&lt;/STRONG&gt; &lt;/U&gt;be oriented to point out of a solid that contains the face.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the answer is already given in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 07:31:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7110557#M58178</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2017-05-26T07:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7110601#M58179</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've downloaded your sample file and investigated the FaceNormals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each of the two Elements, there are six sides having FaceNormal values as expected, all pointing outwards (making my previous post obsolete).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May it be that you compare the faces &lt;EM&gt;by index&lt;/EM&gt;, meaning the first face in the left element's face list is compared to the first face in the second one's face list ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The geometry objects are not returned in order but randomized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I can see, there is no problem at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 08:01:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7110601#M58179</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2017-05-26T08:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111195#M58180</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;dragos.turmac,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I passed null for Level and the right&amp;nbsp;beam was&amp;nbsp;bound to no&amp;nbsp;working plane&amp;nbsp;this time. But both beams' faces' normal are the same as&amp;nbsp;previous.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;New rvt file is atteched for your reference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;Revitalizer,&lt;/P&gt;&lt;P&gt;I understand your points and thank you. Below is my test code to calculate the face normal and snapshot of&amp;nbsp;the result.&amp;nbsp;I was not using index to get the face.&lt;/P&gt;&lt;PRE&gt; Reference refFace = null;
            while (true)
            {
                try
                {
                    refFace = sel.PickObject(ObjectType.Face, "select a face");
                    Element selectedElement = Doc.GetElement(refFace);
                    GeometryObject selectedGeoObject = selectedElement.GetGeometryObjectFromReference(refFace);
                    Face selectedFace = selectedGeoObject as Face;
                    PlanarFace selectedPlanarFace = selectedFace as PlanarFace;

                    BoundingBoxUV box = selectedFace.GetBoundingBox();
                    UV faceCenter = (box.Max + box.Min) / 2;

                    XYZ computedFaceNormal = selectedFace.ComputeNormal(faceCenter).Normalize();
                    XYZ faceNormal = selectedPlanarFace.FaceNormal;

                    MessageBox.Show($"computedFaceNormal: {computedFaceNormal.ToString()}, faceNormal: {faceNormal.ToString()}");
                }
                catch (Autodesk.Revit.Exceptions.OperationCanceledException e)
                {
                    return Result.Cancelled;
                }
            }&lt;/PRE&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="test.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360562i8EE41CAE95154B18/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;there are six sides having FaceNormal values as expected&lt;/SPAN&gt;" you mean the left face's normal of the right beam is (-1,0,0)?&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 13:19:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111195#M58180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-26T13:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111239#M58181</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, I've just read the solid's faces via RevitLookup.&lt;/P&gt;
&lt;P&gt;For both of the elements, there were six PlanarFaces, each with perfect FaceNormal values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May it be that the selection function itself returns a false face ?&lt;/P&gt;
&lt;P&gt;Seems to be the front face instead of the displayed lateral one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 13:32:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111239#M58181</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2017-05-26T13:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111300#M58182</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; MessageBox.Show($"computedFaceNormal: {computedFaceNormal.ToString()}, faceNormal: {faceNormal.ToString()}, Area: {selectedFace.Area.ToString()}");&lt;/PRE&gt;&lt;P&gt;I tested it again. The area are correct, but the face normal...&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360584i614BF02FAA3E16A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 14:01:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111300#M58182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-26T14:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111382#M58183</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when getting the solids and their faces, I draw the normals as ModelLines, starting at the faces' center points:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Normals.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360592i7AF4C2678FE4D233/image-size/large?v=v2&amp;amp;px=999" role="button" title="Normals.png" alt="Normals.png" /&gt;&lt;/span&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;
&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;
&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;
&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;
&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;
&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;All right, this way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I &lt;EM&gt;pick&lt;/EM&gt; a face, I get this result with the left one:&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="NormalsPickedLeft.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360594i20C675975DA8E78A/image-size/large?v=v2&amp;amp;px=999" role="button" title="NormalsPickedLeft.png" alt="NormalsPickedLeft.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But I get this when picking the right one:&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="NormalsPickedRight.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360595iABE4F907DB7ACB5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="NormalsPickedRight.png" alt="NormalsPickedRight.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What does it mean ?&lt;/P&gt;
&lt;P&gt;In fact, the face returned is not transformed to the project context, the solid resides around the 0/0/0 project origin.&lt;/P&gt;
&lt;P&gt;I've drawn the faces' boundaries, too:&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="NormalsPickedRightAllSides.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360598i1F87990E8745C27F/image-size/large?v=v2&amp;amp;px=999" role="button" title="NormalsPickedRightAllSides.png" alt="NormalsPickedRightAllSides.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Strange. No idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 14:31:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7111382#M58183</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2017-05-26T14:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7112539#M58184</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did further investigation. I found that I've&amp;nbsp;added coping on the left beam before. So when I adding coping on the right one it works right! Why? ...&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 07:06:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7112539#M58184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-27T07:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7114195#M58185</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think only The Factory itself can answer the "why" question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 05:49:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7114195#M58185</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2017-05-29T05:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7114395#M58186</link>
      <description>&lt;P&gt;Your comment on coping is the last piece of the puzzle.&lt;BR /&gt;When a familyinstance is&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;cut,&lt;/LI&gt;
&lt;LI&gt;joined&lt;/LI&gt;
&lt;LI&gt;coped&lt;/LI&gt;
&lt;LI&gt;and apparently has been coped&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Revit has to calculate the solids of the instance "in situ" as it will be different from the solids from the family definition. So the normal of the face will be relative to the project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In all (??) other cases Revit treats the solids as "instances" of the solids from the family definition. And by some Revit-logic, when asked for Face.ComputeNormal() it gives the normal relative to the family. Quirkier still it gives the Face.Origin in project coordinates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So with familyinstances that are not cut, joined or coped, you need to transform the faceNormal to project coordinates.&lt;BR /&gt;As you have a reference to the face you can easily test for this condition:&lt;BR /&gt;refFace.ConvertToStableRepresentation(doc).Contains("INSTANCE")&lt;BR /&gt;So add this to your code:&lt;/P&gt;
&lt;PRE&gt;                    if (refFace.ConvertToStableRepresentation(doc).Contains("INSTANCE"))
                    {
                        Transform trans = (selectedElement as FamilyInstance).GetTransform();
                       computedFaceNormal = trans.OfVector(computedFaceNormal);
faceNormal =trans.OfVector( faceNormal));
}
&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 May 2017 08:14:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7114395#M58186</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-05-29T08:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect face normal</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7116619#M58187</link>
      <description>&lt;P&gt;Classic! Thank you all so much!&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 12:09:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/incorrect-face-normal/m-p/7116619#M58187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-30T12:09:26Z</dc:date>
    </item>
  </channel>
</rss>

