How to host one element to another Link element

Hello everybody. :slightly_smiling_face:
Before I start I want to say, that I checked a bunch of topics, where this problem was discussed. Especially this one is the most helpful for me and its’ problem almost similiar to mine.

My goal is to create face-based element on certain place on the wall. (I am replacing level-based elements by the face-based.

The solution from the topic above is set in 2 steps/2 scripts. I made the first part, I created face based element upon the ImportInstance. Its good. Then I delete ImportInstance and get element without base.
So HOW can I set this element to be hosted to the wall (linked element). I dont have any other certain element on the linked model, I only have wall, and the point, where MY face-based element was created before.

I have this switch placed right on the wall, but now it is unlinked. It doesnt have any host. So how can I set this wall (from linked object) as a host?

Please help me with any suggestions.

Maybe the node “LinkElement.Faces” from the BimorphNodes package can help you. It is discussed in this topic.

1 Like

Yep, this node is pretty helpful, it can get you the surface you need, but thats all. I need my element to be hosted to this surface.
Which node can I use here, to set this surface as host? I cant find anything useful.

If you take a close look at the picture posted by @Thomas_Mahon, the “FamilyInstance.ByFace” from the same package seems to do the trick.

Ok, let me explain you all the case. My goal is to create instance by face, using as face the wall from linked object.

Problem is that FamilyInstance.ByFace cant work with faces from linked object. So, as I mentioned, I used some ideas from the post I attached to my topic (check hyperlink). Firstly you create importinstance in your local object just to be able to create Instance where you want it. Then, second part of the solution cant help with my case.
So in result I have instance created on that ImportInstance’s surface. I mean at least I created something, and so I am thinking is it possible to change host element, to change work plane.

I found few topics where people were trying to solve this a few years ago, but those topics are still without solution. ex.

So your problem is, how do you obtain the respective wall from the link when all you have is the original level-based component and its placement point. You need this wall as the host of your new face-based component.

Try this:

  1. Get the facing direction of your existing components, ideally it needs to be consistent
  2. Translate this point by some arbitrary amount along the vector so it is primed and ready to be projected (reveresed) towards the linked wall which is nearest to.
  3. Use the BimorphNode LinkElement.ByRayBounce and input these projected points, the reversed vector and set the findNearest input to true

You should get a list of linked walls which are the new hosts for your families - then you just need to get the face and use it as a host following @MJB-online advice.

1 Like

Sorry for my hurry… I read your post, which MJB-online sent me, more properly. Seems to be your LinkElement.Faces should do the trick with linked objects.

I tried it, but it didnt work for me.

So I have wall from linked object, I got point right on the surface of the wall and the surface itself. I tried all the surfaces, it didnt work anyway. What can be the problem?

Added to my script node LinkElement.OfCategory before LinkElement.Faces and all just worked fine! Thank you very much, although I still dont understand why it doesnt work without it…
And thank you for your Nodes!

Thank you for your help!! :sweat_smile:

1 Like