<?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 Unable to get the 2D geometry of familyinstnace in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8365434#M46678</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the Revit SDK 2017 to read the 2D sheet data with following peace of code, here in case of element type as&amp;nbsp;Autodesk.Revit.DB.Mesh I am getting whole 3D data of mesh. As I am parsing using the document as 3D view&amp;nbsp;active. Can you help me to get the exact 2D geometry from this 3d view.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foreach (GeometryObject geomObj in geomElem)
			{
			//	IList&amp;lt;XYZ&amp;gt; vertexArrList = new List&amp;lt;XYZ&amp;gt;();
				if (geomObj is Solid)
				{
					Solid soliObj = geomObj as Solid;
					if (soliObj != null)
					{
					//	Wall solidWall = soliObj as Wall;
						double zVal = 0.0;
						bool isZvalSet = false;
						{
							foreach (Edge geomEdge in soliObj.Edges)
							{
								IList&amp;lt;XYZ&amp;gt; arrList = geomEdge.Tessellate();
								
								foreach (XYZ array in arrList)
								{
									if (false == isZvalSet)
									{
										zVal = array.Z;
										isZvalSet = true;
									}
									if ((zVal == arrList[0].Z) &amp;amp;&amp;amp; (zVal == arrList[1].Z))
										oVertexArrList.Add(array);
								}
							}
						}
					}
				}
				else if (geomObj is Line)
				{
					Line lineObjforInst = geomObj as Line;
					if (lineObjforInst != null)
						oVertexArrList = lineObjforInst.Tessellate();
				}
				else if (geomObj is Arc)
				{
					Arc arcObjforInst = geomObj as Arc;
					if (arcObjforInst != null)
						oVertexArrList = arcObjforInst.Tessellate();
				}
				else if (geomObj is NurbSpline)
				{
					NurbSpline numbSpline = geomObj as NurbSpline;
					if (numbSpline != null)
						oVertexArrList = numbSpline.Tessellate();
				}
				else if (geomObj is Ellipse)
				{
					Ellipse ellipseObjforInst = geomObj as Ellipse;
					if (ellipseObjforInst != null)
						oVertexArrList = ellipseObjforInst.Tessellate();
				}
				else if (geomObj is Autodesk.Revit.DB.Mesh)
				{
					Autodesk.Revit.DB.Mesh revitMesh = geomObj as Autodesk.Revit.DB.Mesh;
					if (revitMesh != null)
						oVertexArrList = revitMesh.Vertices;
				}
				else
				{
					GeometryInstance geoInst = geomObj as GeometryInstance;
					if (geoInst != null)
					{
						GeometryElement geoElemofInst = geoInst.GetSymbolGeometry();
						ProcessGeomElement(geoElemofInst, ref sbFileContent, ref oVertexArrList);
					}
				}&lt;/PRE&gt;</description>
    <pubDate>Mon, 29 Oct 2018 11:31:32 GMT</pubDate>
    <dc:creator>ritesh.solankeSKPPH</dc:creator>
    <dc:date>2018-10-29T11:31:32Z</dc:date>
    <item>
      <title>Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8365434#M46678</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the Revit SDK 2017 to read the 2D sheet data with following peace of code, here in case of element type as&amp;nbsp;Autodesk.Revit.DB.Mesh I am getting whole 3D data of mesh. As I am parsing using the document as 3D view&amp;nbsp;active. Can you help me to get the exact 2D geometry from this 3d view.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;foreach (GeometryObject geomObj in geomElem)
			{
			//	IList&amp;lt;XYZ&amp;gt; vertexArrList = new List&amp;lt;XYZ&amp;gt;();
				if (geomObj is Solid)
				{
					Solid soliObj = geomObj as Solid;
					if (soliObj != null)
					{
					//	Wall solidWall = soliObj as Wall;
						double zVal = 0.0;
						bool isZvalSet = false;
						{
							foreach (Edge geomEdge in soliObj.Edges)
							{
								IList&amp;lt;XYZ&amp;gt; arrList = geomEdge.Tessellate();
								
								foreach (XYZ array in arrList)
								{
									if (false == isZvalSet)
									{
										zVal = array.Z;
										isZvalSet = true;
									}
									if ((zVal == arrList[0].Z) &amp;amp;&amp;amp; (zVal == arrList[1].Z))
										oVertexArrList.Add(array);
								}
							}
						}
					}
				}
				else if (geomObj is Line)
				{
					Line lineObjforInst = geomObj as Line;
					if (lineObjforInst != null)
						oVertexArrList = lineObjforInst.Tessellate();
				}
				else if (geomObj is Arc)
				{
					Arc arcObjforInst = geomObj as Arc;
					if (arcObjforInst != null)
						oVertexArrList = arcObjforInst.Tessellate();
				}
				else if (geomObj is NurbSpline)
				{
					NurbSpline numbSpline = geomObj as NurbSpline;
					if (numbSpline != null)
						oVertexArrList = numbSpline.Tessellate();
				}
				else if (geomObj is Ellipse)
				{
					Ellipse ellipseObjforInst = geomObj as Ellipse;
					if (ellipseObjforInst != null)
						oVertexArrList = ellipseObjforInst.Tessellate();
				}
				else if (geomObj is Autodesk.Revit.DB.Mesh)
				{
					Autodesk.Revit.DB.Mesh revitMesh = geomObj as Autodesk.Revit.DB.Mesh;
					if (revitMesh != null)
						oVertexArrList = revitMesh.Vertices;
				}
				else
				{
					GeometryInstance geoInst = geomObj as GeometryInstance;
					if (geoInst != null)
					{
						GeometryElement geoElemofInst = geoInst.GetSymbolGeometry();
						ProcessGeomElement(geoElemofInst, ref sbFileContent, ref oVertexArrList);
					}
				}&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 11:31:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8365434#M46678</guid>
      <dc:creator>ritesh.solankeSKPPH</dc:creator>
      <dc:date>2018-10-29T11:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8368027#M46679</link>
      <description>&lt;P&gt;The&lt;SPAN&gt;&amp;nbsp;exact 2D geometry can be tricky to obtain.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Maybe it is even impossible, since 'exact' may depend on different factors.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One way to get exact 2D geometry from a 3D view is to project it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I do so in my room editor to retrieve 2D projected geometry for family instances:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://github.com/jeremytammik/RoomEditorApp" target="_blank"&gt;https://github.com/jeremytammik/RoomEditorApp&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I use a very convoluted approach which is probably not optimal for your needs, but very interesting in itself.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.21" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.21&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 10:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8368027#M46679</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-10-30T10:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8370288#M46680</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917" target="_self"&gt;jeremy&lt;/A&gt;&amp;nbsp;for your replay, we already using the&amp;nbsp;&lt;A href="https://github.com/jeremytammik/RoomEditorApp" target="_blank" rel="nofollow noopener noreferrer"&gt;RoomEditorApp&lt;/A&gt;&amp;nbsp;for our reference.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 05:26:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8370288#M46680</guid>
      <dc:creator>ritesh.solankeSKPPH</dc:creator>
      <dc:date>2018-10-31T05:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8372877#M46681</link>
      <description>&lt;P&gt;Hello Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you explain how to "&lt;SPAN&gt;One way to get exact 2D geometry from a 3D view is to project it.&lt;/SPAN&gt;" project the 3D as I am struggling to to get 2D geometry for&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Solid &lt;/STRONG&gt;geometry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ritesh&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 06:35:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8372877#M46681</guid>
      <dc:creator>ritesh.solankeSKPPH</dc:creator>
      <dc:date>2018-11-01T06:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8400504#M46682</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to get the 2D geometry from the&amp;nbsp;Autodesk.Revit.DB.Mesh, as we get the triangulated mesh data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ritesh&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 06:45:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8400504#M46682</guid>
      <dc:creator>ritesh.solankeSKPPH</dc:creator>
      <dc:date>2018-11-14T06:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8400509#M46683</link>
      <description>&lt;P&gt;A 3D mesh has no 2D geometry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is all 3D.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The one and only was to obtain 2D data from 3D is to use a projection:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/3D_projection" target="_blank"&gt;https://en.wikipedia.org/wiki/3D_projection&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The simplest project in most cases is to simply remove the Z coordinate data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 06:48:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8400509#M46683</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-11-14T06:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get the 2D geometry of familyinstnace</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8400520#M46684</link>
      <description>&lt;P&gt;Yes we are currently doing by removing Z, but it overlaps the edges as there are many edges for triangulated Mesh. In other solution of projection how to project the Mesh data on planer face, as such i don't found any method in Mesh class, here is one method&amp;nbsp;Mesh get_Transformed(Transform transform);&amp;nbsp; can we use it ?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 07:00:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/unable-to-get-the-2d-geometry-of-familyinstnace/m-p/8400520#M46684</guid>
      <dc:creator>ritesh.solankeSKPPH</dc:creator>
      <dc:date>2018-11-14T07:00:12Z</dc:date>
    </item>
  </channel>
</rss>

