Host Property returns null

Host Property returns null

grahamcook
Advocate Advocate
622 Views
4 Replies
Message 1 of 5

Host Property returns null

grahamcook
Advocate
Advocate

Hi

I am trying to establish what object (if any) a family instance is hosted on.  In all cases the Host property returns null (2022).  Just to sanity check I also used the Revit Lookup tool.  This confirmed the null value even though the instance was clearly hosted in the UI.
I know its NOT possible to change the host of an existing instance (only when creating it) but thought it was still possible to get the current host?

Screen shot below.

grahamcook_0-1652367677877.png

 

0 Likes
623 Views
4 Replies
Replies (4)
Message 2 of 5

Simon.Pusateri
Contributor
Contributor

Hi Graham, 

 

If you try and use the Pick New Host command in Revit, does that property update in the Snoop Objects browser? In my experience it seems that sometimes Revit sees the Host and the Level the instance is on as two separate properties, so even if it on the 01 - Entry Level, it could be unhosted. Sorry I can't provide a more concrete answer - best of luck!

Simon

0 Likes
Message 3 of 5

grahamcook
Advocate
Advocate

Cheers Simon.
Re-hosting in the UI changes nothing.  In this case the instance is "hosted" on the right level and shows the correct Level in Lookup.  But the Host (which should be Floor) is null even though the instance is clearly hosted on a Floor.
I have tested other scenarios as well, for example, a tree hosted on a topo surface will have a host of null in the API but a host of "Surface" in the UI.
Frustrating!

0 Likes
Message 4 of 5

RPTHOMAS108
Mentor
Mentor

Yes that is a common issue. The tree family is not workplane based so although it reports the name of the host type in that parameter it doesn't expose the host id to the API. That host name parameter value is also available to the API as text but that isn't that helpful because many elements can share that type name.

 

Workplane based families populate the host id property on the class but not the host id parameter. So it seems there is some internal confusion regarding how all these things should be exposed to the API.

 

below is what I've found:

 

TemplateFamilyInstance.HostIdHOST_ID_PARAM
   (present and populated)
Floor basedYesYes
Wall BasedYesYes
Face BasedYesNo
GenericNoNo

Generic

(Workplane Based Option)

YesNo
DoorsYesYes
Windows (no trim)YesYes
Message 5 of 5

grahamcook
Advocate
Advocate

RPTHOMAS108

Thanks for your input on this one.  Yes, I can see the name of the Floor Type its hosted on in the "Host" parameter and the "Host Id" parameter is null. 😞
Back to the drawing board on this one then to think of an ugly workaround!

0 Likes