Modified Floor Top Surface


Hi all,

I was trying to get the surface of the modified floor points but still no success. as a start please see attached images of what im trying to do.

Thank you.

Element.Geometry returns null with Floors
Get Surface By Orientation : Sloped/Inclined Surfaces

Hi @interactiverendering
Something like this should work :

But I get the feeling that dynamo is going to have a hard time getting the geometry of this floor… I came up with a bit of code as a workaround to a similar issue in the past. It could be improved but here it is :

import clr
from Autodesk.DesignScript.Geometry import Surface as DSSurf
from Autodesk.Revit.DB import*
import Revit
import sys
pyt_path = r'C:\\Program Files (x86)\\IronPython 2.7\\Lib'
import collections

def tolist(input):
	if isinstance(input,list):
		return UnwrapElement(input)
		return [UnwrapElement(input)]

def flatten(l):
    for el in l:
        if isinstance(el, collections.Iterable) and not isinstance(el, basestring):
            for sub in flatten(el):
                yield sub
            yield el

def tostring(x):
	return x.ToString()
def getgeomlist(x,opt):
	return list(x.get_Geometry(opt))
def getlength(c):
	return c.Length

def getfaces(x,opt):
	#getting geometryelements as list
	geomelems = getgeomlist(x,opt)
	#getting nested instance geometry for all geometry instances
	while any('GeometryInstance' in g for g in map(tostring,geomelems)):
		for index,i in enumerate(geomelems):
			if 'GeometryInstance' in i.ToString():
				geomelems[index] = i.GetInstanceGeometry()
	geomelems = list(flatten(geomelems))
	#getting all faces, keeping meshes
	faces = []
	for i in geomelems:
		if 'Solid' in i.ToString():
		elif 'Mesh' in i.ToString():
	faces = list(flatten(faces))
	return faces

geomoptions = Options()
fcs = []
elems = tolist(IN[0])
for e in elems:
	faces = getfaces(e,geomoptions)
	tlist = []
	for f in faces:
			edges = list(f.GetEdgesAsCurveLoops())[0]
			dsedges = [e.ToProtoType(True) for e in edges]
			crosssections = sorted(dsedges,key = getlength)[-2:]
			loft = DSSurf.ByLoft(crosssections)

OUT = fcs


Thanks Mostafa, the second one works, just not sure if i can hide those lines as shown


No problem :slight_smile: What is your end goal?


My end goal is to get floor surface and if possible join them as one and show only the outside boundary (if not possible at least to get the boundary curves)


Oh so you just want the sketch of the floor ! There’s a node in spring nodes for that:

You can then make it a polycurve and use surface.bypatch to get the surface . But it’ll be flat . The top surface of the modified floor is tessellated and there’s not much you can do about that…


I tried that already but it’s not getting the boundary of top surface(modified floor points height) just the sketch whic is flat


Just as a workaround proposal, selecting the faces directly on the model with Springs.SelectFaces+ would not fit your needs?


I see. This should work :
-get the geometry of top faces as shown previously
-join the surfaces with polysurface.byjoinedsurfaces
-get the perimeter curves of the polysurface


Great! Thank you very much Mostafa :slight_smile:


could work also i’ll try this as an option for now…Many Thanks :slight_smile: