Get floor pattern line

Hello everybody

I’m willing to know if there is a way to get the lines of the material used in the floors

these lines are the red ones from the image below.


Thank you very much for your support!


It is not an easy task.
You could use the Compound Pattern Reference node as a starting point.
I think you have to go through the References (API method) to retrieve some points on the red lines.

You can also try getting a FillGrid from the Fill Pattern using the code like this (or nodes shown by Alban probably as well). Then having fill grids you should be able to ‘calculate’ the lines using objects transformation (location, angle etc.) and fill grid’s properties (offset,angle,origin etc.).
Then you’d have to trim those lines with floor’s boundary (if that’s needed).

import clr
from Autodesk.Revit.DB import *
#The inputs to this node will be stored as a list in the IN variables.
elements = UnwrapElement(IN[0])

output = []

for e in elements:
	for m in e.Materials:
		if not m.SurfacePattern is None:
			fp = m.SurfacePattern.GetFillPattern()
			for fg in fp.GetFillGrids():

#Assign your output to the OUT variable.
OUT = output
1 Like

Thanks for your support, but i got this error message

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 10, in
AttributeError: ‘Floor’ object has no attribute ‘Materials’

might be an API change, it seems that there is a GetMaterialIds() method instead in the newer versions.
Nevertheless I was probably wrong on the calculation part, if you take a look at this post:

However they propose another approach with references (more along with Alban’s solution I guess)

Unfortunately, none of these nodes provides me an easy approach to what i intend to get.

Any other tips?

Thank you!