Placing a family instance on floor

Hello everybody.
I’m trying to place a concrete pad under a panel, but I’m facing with 4 different issues in my script.
1.- the instance family is placed in the wrong location. See image below

2.- I run the script once and it works well, then, I run it the second time to place another instance under another panel and what it does is move the previously placed instance to the new location. I don’t know how to fix that or maybe I don’t understand how it works.

3.- when I run the script in another floor, it places the pad on the 1st floor!!! even when I specifically provide the point with the correct elevation.

4.- Sometimes, the script works well. I don’t know why when it doesn’t.

Can anybody help me in at least one of the issues?

Try running your graph in Dynamo Player and see how much that fixes. One of the major issues you’re running into is Element Binding. The issue with the mismatched coordinates is probably just from showing values from different coordinate systems. On the initial run, does the pad actually get placed in the wrong location or does it just show different coordinates?

Thanks for your response, Nick.
The pad is placed in the wrong coordinates. Actually, I don’t see it in my project. It should be outside boundaries.

What you mean with Element binding and how to fix that?

I ran it with the player but nothing was fixed.

Sometimes, I run it selecting, let’s say 4 panels. It places correctly in 3 of them, but the last one is lost in space

Element Binding is essentially Dynamo remembering the Revit transactions that have occurred while the graph is open and “updating” rather overwriting. This is why running the graph with a different panel selection “moves” the pad rather than placing a new one. Dynamo Player avoids this problem.

Oh, ok. I got you. The first thing I did, I thought it was going to be fixed that way, but , for my surprise, it didn’t.

After taking a second look at the coordinates, it looks like the X and Y coordinates flip. I’m wondering if there’s some weird transform going on with either the family or the project coordinates. The family may also be hosted and trying to find a Z-plane to associate with when placed, causing it to “fly off” into space if nothing is nearby. (Or it could just be related to the mixed up coordinates.)

Yeah. I just asked the person who created the families. He says that all the face based families have a flip. I have to figure out how to reverse the flip. That would solve the first issue.


I don’t understand why this is happening. It’s really frustrating

Impossible to say without seeing your model. If you can post a stripped down example file with the dyn and show where it’s happening you might have more luck.

I can upload any file from my computer due to company policy. What I ca do is show you what’s going on.
Place HK Pads

As you can see, out of the three selected panels, only two pads are shown. But when you check the coordinates you see that for the missing one, are negated. Sometimes they are negated and other times they are flipped. Totally random in my understanding.

It doesn’t have to be a project file. That’s one of the reasons we usually ask for a stripped down example file. It can be just a few panels in order to see what’s happening. Otherwise it’s pretty hard to troubleshoot these kinds of things.

Hi Nick, sorry for the delay. I attached a project and the script file and thank you for your help

Project2.rvt (5.6 MB)
Place HK Pad.dyn (93.6 KB)

Place HK Pads2

Hey Nick, did you get the files I attached?

It’s not recommended to use hosted families in this way for exactly these reasons. It’s much harder to ensure that hosting is setup properly in order to get geometry correct when an unhosted family can just be placed and modified. You can even see that elements hosted via the API don’t have the same control as elements hosted via the UI if you look at some of their parameters. Change this to an unhosted family and you should have much better luck.

I change the family for an unhosted one and it worked!
Thanks!!