I looked through the API docs and I couldn’t find anything, but I might still be missing something here.
Is there an analog to Pick New Host in the API?
Did you ever find an answer to this? I’m looking for the same question’s answer.
The property HostId can be retrieved and set, so this Python script should do it:
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager doc = DocumentManager.Instance.CurrentDBDocument doc = DocumentManager.Instance.CurrentDBDocument railing = UnwrapElement(IN) newhost = UnwrapElement(IN) TransactionManager.Instance.EnsureInTransaction(doc) hostId = newhost.Id railing.HostId = hostId TransactionManager.Instance.TransactionTaskDone() OUT = railing
I totally forgot I made this topic.
I eventually found the HostId thing and it turned out to be straightforward. The thing I was working on though took another way so I never used it.
The sample script from @awilliams is working and it’s great.
5 posts were split to a new topic: Pick new host lighting fixture
@Mark.Ackerley moved to new topic here