Last active
September 1, 2016 01:01
-
-
Save gtalarico/9d369510c147638439553256851ffc06 to your computer and use it in GitHub Desktop.
RevitAPI::Code Snippets::Get Phase By Name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Autodesk.Revit.DB import Phase, FilteredElementCollector | |
def get_phase_by_name(phase_name): | |
phase_collector = FilteredElementCollector(doc).OfClass(Phase) | |
for phase in phase_collector: | |
if phase.Name.Equals(phase_name): | |
return phase | |
phase = get_phase_by_name('01 - Existing') | |
print phase.Name | |
print phase.Id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment