-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRegEx.py
49 lines (35 loc) · 1.07 KB
/
RegEx.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
Create a simple Wall objects using python
"""
__author__ = 'Onur Korkmaz'
"""
Sample on how to create a Wall.
Use this sample along with the Video on Youtube.
"""
import clr
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
#Preparing input
walls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements()
names = []
for i in walls:
names.append(i.Name)
def check_family_name(family_name):
pattern = r'^[A-Z]{1}[0-9]{4}\.[0-9]{2}_\w+$'
if re.search(pattern, family_name) == None:
return "İsimlendirme kuralına uygun."
else:
return "İsimlendirme kuralına uymuyor."
list = []
for i in names:
list.append(check_family_name(i))
#result = check_family_name(names)
OUT = names , list