- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone! I’m trying to update a ColorSchemeEntry. I’ve grabbed the scheme, and the entry, and I’ve changed the color, but running scheme.UpdateEntry(entry) in a transaction doesn’t seem to do anything. I understand color schemes are updated asynchronously, so is there some way to entice Revit to update? (I've read over the api docs remarks, they're slightly confusing: ColorFillScheme Class on revitapidocs ).
Code below shows where the magic (should) happen. I’ve tested before and after the "entry.Color = DB.Color" line and the color is definitely being changed, it’s just not being updated in the scheme. I'm not getting any errors, the transaction commits, but the scheme doesn't seem to update. 🤔
scheme.CanUpdateEntry(entry) passes as well, so I’m allowed to update the entry… any ideas are welcome and appreciated! Oh yeah, this forum post got me where I am now, it was very helpful! Thanks sofia! https://forums.autodesk.com/t5/revit-api-forum/creating-color-schemes-through-the-api-revit-2022/td-...
Thanks!
with DB.Transaction(doc, 'Update {} Color'.format(entry_name)) as t:
t.Start()
entry.Color = DB.Color(color.red, color.green, color.blue)
if scheme.CanUpdateEntry(entry):
scheme.UpdateEntry(entry)
t.Commit()
Solved! Go to Solution.