Hosting Sprinklers to ceiling


I have a script which places sprinklers freely in a space at a specified height by the user. If I have a ceiling in a room at the default height of 2400mm, I can place my sprinklers at that height, but they do not automatically connect to the ceiling, even if I place a hosted family type…
Is there any way to host the sprinklers to a ceiling? The “Host” parameter in Revit seems like its read only so I’m not sure if its possible.

Any advice would be appreciated.
Thank you