-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetSetParameter.py
34 lines (29 loc) · 1.11 KB
/
GetSetParameter.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
# -*- coding: utf-8 -*-
import clr
clr.AddReference("RevitAPI")
clr.AddReference("System")
from Autodesk.Revit.DB import FilteredElementCollector as Fec
from Autodesk.Revit.DB import BuiltInCategory as Bic
from Autodesk.Revit.DB import BuiltInParameter as Bip
from Autodesk.Revit.DB import Transaction
tx = Transaction(doc, "check structural level offsets")
tx.Start()
rooms = Fec(doc).OfCategory(Bic.OST_Rooms).WhereElementIsNotElementType().ToElements()
areas = Fec(doc).OfCategory(Bic.OST_Areas).WhereElementIsNotElementType().ToElements()
for room in rooms:
try:
print(room.get_Parameter(Bip.ROOM_NAME).AsString())
value0 = room.LookupParameter("Geschoss").AsString()
room.LookupParameter("temp").Set(value0)
except:
print(room.Id)
for area in areas:
id = area.get_Parameter(Bip.AREA_SCHEME_ID).AsElementId()
if str(id) == "522977":
try:
print(area.get_Parameter(Bip.ROOM_NAME).AsString())
value1 = area.LookupParameter("Geschoss").AsString()
area.LookupParameter("temp").Set(value1)
except:
print(area.Id)
tx.Commit()