Revit API: Get Solid Fill Pattern
Learn how to get Solid Fill Pattern. It can be useful in creating Graphics Override Settings.
π Get Solid Fill Pattern
If you are trying to override your graphic settings then you will most likely want to get SolidFillPattern
. There are different ways to get it, but I prefer to use list comprehension to filter out fill pattern with .IsSolidFill
property.
If you want to learn more about how to Overriding Graphics, read more in another blog post I wrote.
And Finally, Here is the Snippet to get Solid Fill Pattern!
- code
-
# -*- coding: utf-8 -*- #β¬οΈ IMPORTS from Autodesk.Revit.DB import * #π¦ VARIABLES doc = __revit__.ActiveUIDocument.Document #π¦ Get All Fill Patterns all_patterns = FilteredElementCollector(doc)\ .OfClass(FillPatternElement)\ .ToElements() #π Filter Solid Fill Pattern solid_pattern = [i for i in all_patterns if i.GetFillPattern().IsSolidFill][0] __author__ = 'πββοΈ Erik Frits'
β¨οΈ Happy Coding!
— Erik Frits
π© Join Revit API Newsletter
Get notified when Revit API Course is coming. Best Deal Guaranteed!
Meanwhile, you will be receiving Newsletter with useful Tips & Tricks for Revit API
Meanwhile, you will be receiving Newsletter with useful Tips & Tricks for Revit API