Finding Folders¶
Finding Folders¶
1impact.gui.output_toolbox.clear()
2
3projects = impact.active_database.projects
4
5# Find a "1. Production" folder in the projects folder
6
7folder1 = projects.find("1. Production")
8
9if folder1 is not None:
10 impact.gui.output_toolbox.add("Successfully found '" + str(folder1.folder_name) + "'")
11else:
12 impact.gui.output_toolbox.add("Unable to find folder")
13
14# Find a "1. Production\2005\\January" project folder using a full path
15
16folder2 = projects.find_child_by_display_path("1. Production\2005\\January")
17
18if folder2 is not None:
19 impact.gui.output_toolbox.add("Successfully found '" + str(folder2.display_path) + "'")
20else:
21 impact.gui.output_toolbox.add("Unable to find folder")
22
23if folder1 is not None:
24
25 # Find a r"2005\\January" folder using a relative path from folder1
26
27 folder3 = folder1.find_child_by_display_path(r"2005\\January")
28
29 if folder3 is not None:
30 impact.gui.output_toolbox.add("Successfully found '" + str(folder3.display_path) + "'")
31 else:
32 impact.gui.output_toolbox.add("Unable to find folder")
33