about 6 years ago by Ali Safieddine
In this tutorial the tutor is calling shelves types by their elementId but what will happen if we change the project? As far as I know the ids of these elements will change right? if so, then the plugin will not call these type elements
Sam Aston almost 6 years ago
Hi Ali, we would have to use filters to narrow to the id you want to work with. I, personally find the Revit Python Wrapper's collectors to be easier to work with: https://revitpythonwrapper.readthedocs.io/en/latest/db/collector.html?highlight=filters
For example, in a project where you have a titleblock with the name "TB-Cut Sheet 11x17", you can type:
hosttitleblockFilter = db.Collector(of_category='OST_TitleBlocks', where=lambda x: x.name=="TB-Cut Sheet 11x17")
hosttitleblockElem = hosttitleblockFilter.get_first()
hosttitleblocklelemId = to_element_ids(hosttitleblockElem)
And use that to retrieve the element ID of the titleblock. I hope that clarifies things.