<?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 Room Separation Line - Associated Level in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7607669#M54099</link>
    <description>&lt;P&gt;Is it possible to get the associated level of a Room separation Line by creating a simple Macro, as it isn't available in the properties.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iplaod.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/436620iB5FBDD3D0BEC4569/image-size/medium?v=v2&amp;amp;px=400" role="button" title="iplaod.PNG" alt="iplaod.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;I checked in the Revit 2017.1 API documentation but couldnt find&amp;nbsp; anything related to Room Separation Line.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2017 10:16:31 GMT</pubDate>
    <dc:creator>gprofile</dc:creator>
    <dc:date>2017-12-08T10:16:31Z</dc:date>
    <item>
      <title>Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7607669#M54099</link>
      <description>&lt;P&gt;Is it possible to get the associated level of a Room separation Line by creating a simple Macro, as it isn't available in the properties.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iplaod.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/436620iB5FBDD3D0BEC4569/image-size/medium?v=v2&amp;amp;px=400" role="button" title="iplaod.PNG" alt="iplaod.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;I checked in the Revit 2017.1 API documentation but couldnt find&amp;nbsp; anything related to Room Separation Line.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:16:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7607669#M54099</guid>
      <dc:creator>gprofile</dc:creator>
      <dc:date>2017-12-08T10:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7607739#M54100</link>
      <description>&lt;P&gt;You should be able to get the owner view, cast it as ViewPlan and get the Level from the view plan.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; var viewPlan = (ViewPlan) Document.GetElement(modelCurve.OwnerViewId);
 var level = (Level) Document.GetElement(viewPlan.LevelId);&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Dec 2017 10:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7607739#M54100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-08T10:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608555#M54101</link>
      <description>&lt;P&gt;the room separation line can be visible in floorplans of a different level, or even in 3D views.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this will sound a bit hacky, but the name of the sketchplane of the separationline is equal to the name of the level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;                SketchPlane sk = modelcurve.SketchPlane;
                IEnumerable&amp;lt;Level&amp;gt; levels = new FilteredElementCollector(doc)
                	.OfClass(typeof(Level))
                	.Cast&amp;lt;Level&amp;gt;()
                	.Where( l =&amp;gt; l.Name.Equals(sk.Name));
                Level LevelofLine = levels.FirstOrDefault();
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;another approach&amp;nbsp;would be to find the level by the height from the sketchplane.Plane&amp;nbsp;&amp;nbsp;[ height = sk.&lt;SPAN&gt;GetPlane&lt;/SPAN&gt;().Origin.Z ]&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 15:23:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608555#M54101</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-12-08T15:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608695#M54102</link>
      <description>&lt;P&gt;Excuse me for my ignorance in C# i tried the code below but couldn't solve the error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="g-section"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="g-unit"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;Error CS0039: The Autodesk.Revit.DB.GeometryObject type cannot be converted to Autodesk.Revit.DB.ModelCurve with a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or NULL type conversion.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="trans-verified-button-small"&gt;&lt;PRE&gt;UIDocument uiDoc = this.ActiveUIDocument;
Document doc = uiDoc.Document;
			
Reference myRef = uiDoc.Selection.PickObject(ObjectType.Element);
Element ele = doc.GetElement(myRef);
			
GeometryObject geomObj = ele.GetGeometryObjectFromReference(myRef);
ModelCurve modelcurve = geomObj as ModelCurve;
			
SketchPlane sk = modelcurve.SketchPlane;
IEnumerable&amp;lt;Level&amp;gt; levels = new FilteredElementCollector(doc).OfClass(typeof(Level)).Cast&amp;lt;Level&amp;gt;().Where( l =&amp;gt; l.Name.Equals(sk.Name));
Level levelOfLine = levels.FirstOrDefault();&lt;/PRE&gt;&lt;SPAN&gt;Please guide me.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Dec 2017 15:58:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608695#M54102</guid>
      <dc:creator>gprofile</dc:creator>
      <dc:date>2017-12-08T15:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608740#M54103</link>
      <description>&lt;P&gt;The GeometryObject is not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can get the modelcurve directly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ModelCurve modelcurve = doc.GetElement(myRef) as ModelCurve;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 16:09:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608740#M54103</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-12-08T16:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608831#M54104</link>
      <description>&lt;P&gt;I cannot understand why this code throws a null Exception, when I select a Line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;UIDocument uiDoc = this.ActiveUIDocument;
			Document doc = uiDoc.Document;
			
			Reference myRef = uiDoc.Selection.PickObject(ObjectType.Element);
			Element e = doc.GetElement(myRef);
			ModelCurve modelcurve = e as ModelCurve;
			
			var viewPlan = (ViewPlan) doc.GetElement(modelcurve.OwnerViewId);
 			var level = (Level) doc.GetElement(viewPlan.LevelId);
 			
 			TaskDialog.Show("Level is : ",e.Name + level.Name);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="warning.png" style="width: 371px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/436799i10BAE9FC4963F7EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="warning.png" alt="warning.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;</description>
      <pubDate>Fri, 08 Dec 2017 16:31:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7608831#M54104</guid>
      <dc:creator>gprofile</dc:creator>
      <dc:date>2017-12-08T16:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Room Separation Line - Associated Level</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7611608#M54105</link>
      <description>&lt;P&gt;a room separation line is a model element, and as such it doesn't have a OwnerView. ( Only annotation elements have a Ownerview.)&lt;/P&gt;
&lt;P&gt;so&lt;/P&gt;
&lt;P&gt;modelcurve.OwnerViewId = ElementId.InvalidElementId, resulting in doc.GetElement(modelcurve.OwnerViewId)&amp;nbsp;= null&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Dec 2017 14:59:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/room-separation-line-associated-level/m-p/7611608#M54105</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-12-10T14:59:41Z</dc:date>
    </item>
  </channel>
</rss>

