c# - Gettings information about stairsruns and stairs from elements containing such information -


hello have following code:

   public static void handlestairs(document doc)         list<transitionpoint> ret = new list<transitionpoint>();         filteredelementcollector collector = new filteredelementcollector(doc);         icollection<element> stairs = collector.ofcategory(builtincategory.ost_stairs).toelements();             foreach (var stair in stairs)              {                  var st= stair stairs;                  if(st!=null)                  {                         %code never executed                  }              }          return ret;     } 

now problem no matter appears stairs null, heard programmer had same problem.

the stairs variable receive number of object stairlike properties (being named staircase, having risers , platforms ext.) not appear accept being cast stair. know how cast stairs (or otherwise obtain stairs in document?)

note stairs element following properties:

riser tread connection monolithic material apply nosing profile stringer material text size begin riser stringer carriage height url open stringer offset right stringer riser type cost left stringer underside of winder stringer height nosing profile manufacturer middle stringers keynote riser material minimum tread depth text font monolithic stairs maximum riser height landing carriage height break symbol in plan landing overlap extend below base nosing length assembly description end riser description function type image type comments stringer thickness assembly code calculation rules trim stringers @ top model tread thickness tread material riser thickness 

i need stair objects runs assosiated stair objects, or need paths runs follow.

this can used following:

 var tesselated = new list<xyz>();  var stairpath = run.getstairspath();      foreach (curve curve in stairpath)      {          tesselated.addrange(curve.tessellate());      } 

because need xyz locations positions stairs attached geometry of building.

first of all, absolutely have find out , tell kind of element talking about. otherwise, discussion pointless. 1 easy way determine explore 'stair-like' element using revitlookup:

https://github.com/jeremytammik/revitlookup

if not know revitlookup is, should stop absolutely else doing revit api right away , start off fresh working through revit api getting started material, installing , starting use revitlookup:

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

the filtered element collector show retrieves elements of 'stairs' category. 'stair-like object' directshape, in case can assign 'stairs' category. retrieved filtered element collector above.

here example of 'stair-like' extruded roof, , remain roof, 'roofs' category, , can never identified filtered element collector:

http://thebuildingcoder.typepad.com/blog/2014/09/events-again-and-creating-an-extrusion-roof.html#7

sorry confusing answer, must question pretty confusing too. never heard before. hope helps.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -