Align to Linked Host

Topic is to discuss best way to align a face based family to a linked host. In example, a card reader on a wall that is from a linked architecture model. The idea would be to get a certain family or type, get their host element (whether it be a wall or geometry), and align the family to the center of its respective host. Sometimes the host is a nib wall sticking out or some form of geometry.

Any good working examples out there?

I have an idea of getting this to work but at the moment it involves a lot of filtering and tests. Ideally I was seeing if Element.Host (from Clockwork) would output the family’s respective host so I could then work off from but I seem to be having trouble utilizing the Linked Instance that comes out and how to then align the family to the center of the host. Are there native or packages with an align command or are they purely translation nodes? Thanks!

Hi @Dynamonkey
Try using “Element.SetLocation” node from spring nodes package. Before setting location get center point of host.

@Kulkul

If I am not mistaken, isn’t the difficult part still left? Getting and associating the family to its host? I would need to do that in order to be able to get the center point. When using Element.Host the output I get is a linkedinstance which I could not use to get geometry and in turn a centroid. That is where I am stuck. Any advice?

Below is an example of rooms. How to get geometry from link file.

It would be better if you can drop files if you need solution :slight_smile:

Hi @Kulkul

Obtaining Linked elements, that I know. The question again is getting the host of a face based family. Sure we could obtain all linked elements and run it through many filters and tests but that is what I am trying to avoid and seeking a simpler solution if possible. That is why I am asking and curious about Element.Host or any other method as it seems to be the right direction.

In that case try using “Element.Host” from clockwork package. Currently i am away from my system. I will provide you solution tomorrow meanwhile someone else can put some light on this.

Edit: Since you have already tried using Element.Host then need some python work here.

@Dynamonkey How about this?

Hi Kulkul do you mind sharing what you have? It is a little difficult to see what is going on in that moving image. Thanks!

Here is a downloadable gif you can just click on it.

You could just screenshot your script and how are we supposed to know what’s in your python code?

@Dynamonkey my gif workflow was just to ask you if this is what your looking for? I will just wrap everything in custom node and paste here custom node in about 10 hours from now.

Hi @Dynamonkey
Here is the custom node Element.Host(Linked Elements).dyf (9.1 KB)

And Here is GIF in action:

Note: If you need single Element host you need add “List.Create” before connecting to "Element.Host(Linked Elements)"

See Below:

Hi,

I Placed Lighting Switches on walls & columns. Walls and Columns are in linked model.
I want to know which switches are hosted columns and which are hosted walls.
I used your your script Element.host(Linked Elements).
I didn’t get output. Please help me to share corrected “.dyf” file.
image
Thanks,
Jagan

You are a Chief!!It works all good