Re-host a face based FamilyInstance in a Revit 2013 project via the API

Re-host a face based FamilyInstance in a Revit 2013 project via the API

Anonymous
Not applicable
1,016 Views
3 Replies
Message 1 of 4

Re-host a face based FamilyInstance in a Revit 2013 project via the API

Anonymous
Not applicable

I feel like this topic has probably been covered, but I wasn't able to turn up anything by searching.

 

I want to use an API program/script to rehost orphaned/not-associated face-based family instances (lighting fixtures and air terminals in particular) to a ceiling.  The ceiling lives in a linked model.  I can work out from the API documentation how to build the selection set of orphaned/not associated instances, and I figure I can locate the ceiling by raycasting from the element I'm trying to rehost--that's the easy part.  The hard part appears to be changing the host once I have that information in hand.

 

I have spent a pretty good chunk of time searching the API reference and I can see how to read the Host, but I have yet to find any way to change the host of an existing FamilyInstance.  Is there a way to do this, or is the only way forward to create a new FamilyInstance on the new host, copy the properties over, and move the connections from the old to the new element?

 

Thanks in advance, everyone!

0 Likes
1,017 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Bump.  Can this be done from the API in Revit 2013?  Can it be done at all?

0 Likes
Message 3 of 4

Anonymous
Not applicable
I'm still in the process of researching this myself, but I think you'll probably have to either recreate the item itself and replace on the host you've found from Raycasting. My current issue is doing this when the host you want is in a linked model but I'm hearing that this can be done based on new items in the 2014/5 API.
0 Likes
Message 4 of 4

ABertzouanis9F98Y
Enthusiast
Enthusiast

Is there any hope of achieving this in Revit 2021 or Revit 2022 API?

0 Likes