Message 1 of 7

Not applicable
05-15-2018
01:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
So I am trying to filter all the beams in my project and set values to the Parameter Mark. I would like to mark it in a sequence, say from 3 to 10. Here are what I have done so far:
from Autodesk.Revit.DB import * doc = __revit__.ActiveUIDocument.Document bc = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_StructuralFraming).WhereElementIsNotElementType().ToElements() t = Transaction(doc, 'Mark changing') t.Start() for bm in bc: mark = bm.LookupParameter("Mark") if mark: for i in range(3,10): newMark = mark.Set(str(i)) t.Commit()
I have 7 beams and if this code works, it should give them the Mark value of 3, 4, 5, 6, 7, 8, 9, respectively. However, my code only give all beams one value of 9. I would appreciate any help.
Cheers
Thai
Solved! Go to Solution.