Place wall hosted object (electrical receptacle)

Just trying to quickly automate a relatively straightforward task as a way to get more familiar with Dynamo. I’d like to place electrical receptacles along the walls of a room to follow code (every 8 feet on walls longer than 2 feet, etc.).

I don’t use Dynamo much (I’m a long-time Revit user and like to script and use Grasshopper for Rhino), so just discovered the Springs node package. So with LunchBox I quickly got the walls, divided the wall location curves by distance, and placed the OOTB Standard Duplex Receptacle with Springs.HostedInstance.ByPoints.

First problem, the OOTB receptacle is surface hosted, not wall hosted, so it hosted to the underside of the wall. Made a new receptacle family that is wall hosted, which helped a bit, but some are placed at the point along the curve on the wall, some are not (and are even not on a wall at all!).

Second problem, they are hosted on the exterior face of the wall, so I need to figure out a way to specify interior or exterior (preferably referencing a room to determine, not the wall orientation, but that is for later).

I’m using this as a way to get my feet wet, so I’d appreciate help in the spirit of teaching/learning, not just a solution. Thanks!

1 Like

Hello Damon,

I think the problem here is the nested lists, can you make it work with only one wall? If that is the case you have at least two options:

  1. Rewrite the python script in HostedInstance.ByPoints to accept nested lists.
  2. Wrap the graph that works for one wall in a custom node, and feed it several walls.

The location curve of the wall is the centerline curve at Base Level. If you want to place your family instance at a higher elevation you will have to translate the line or your points.

If you want to place a family instance at a face you can use the other node i Spring Nodes “FamilyInstance.ByFacePoints”. Here is one way to get the wall surfaces facing a room:

1 Like

Thank you for your response. I’ll give these solutions a try!

(I have to admit, coming from Grasshopper for Rhino, I’m finding working with Dynamo very difficult… probably because I’m predisposed to think in a Grasshopper-y way and because of just general unfamiliarity.)

1 Like


How is this receptacle placement script coming along? It is on my to-do list as well
I inserted an elevation change to your script, but it needs to get moved so it places only one receptacle at the higher elevation. The receptacle placement comes in facing up instead of out. Another hurdle for me to figure out


Hi, Bill.

So happy to have a co-conspirator to work on my script! No, I have not made any more progress beyond what I posted. I spent a few minutes struggling with Einar_Raknes’s suggestions. I’m not up to rewriting the Python script and I’m too green with Dynamo to understand how to “wrap the graph… in a custom node”. I tried a few things, but with no success.

Part of my problem is that I keep thinking how to translate how I’d do this in Grasshopper to how to make it work in Dynamo. I doubt that that is the most productive though process.

If I make it any further, I’ll post again. I hope you’ll do the same!


I know that this is almost a year old but i’m also trying to do something similar and wondering if this has been figured out and if so how did you get it to work. Also, I’m a newbie to Dynamo so I don’t have a ton of knowledge on how to create in Dynamo.

Hi, Austin. I certainly never figured it out. Anybody else out there have a great way to automate placing wall-hosted objects around the perimeter of a room?


where did you guys find the Lunchbox?

On the top ribbon you will see a tab for "Packages"
Drop down list says "Search for packages"
Enter “Lunchbox” in the search ribbon and it will come up, should be the first one


How could we design this so that it reads the rooms and then does all of the calculations that are used for that room?

1 Like

Guys, The follow up questions should start a new thread. Now we have many questions and many answers. You could link the similar topic if the topic is similar to your query. Please ask OP’s to start a new thread. Thanks :slight_smile:

Has anyone looked into what Damon and I are working on up top?
Trying to place wall-hosted objects at specific locations.

See what’s in this thread maybe:

Hi There,
I was able to place it in the host the issue is that it will not reorient into another wall direction.

SetRotation_End v6.dyn (33.3 KB) PlaceFamily_Start.rvt (2.0 MB)

I don’t know what is causing that. Receptacles are wall hosted, no idea why they want to flip horizontal when using this script.

Just wanted to come in, since I started this thread. I haven’t worked on this for some time… maybe it’s time I look at it again

Me either

2 Guess to fix this issue (trying to solve it myself) I think one method is to rebuild the family with the planes rotated so that Front Plane != Front face of outlet but have the Top plane = Front face of outlet.

The other guess I have is based on the following links. I think the springs node is using the New FamilyInstance Method. From github for springs I see “doc.Create.NewFamilyInstance(p,ftype[j],host[k],level,strt)” in the nodes base code. This leads me to think the “level” value is acting as the second XYZ input which is why the outlets lie flat to the levels plane.

I may slap some python together to say get level of wall and translate the “Reference Direction” input of the overload method of FamilyInstance Method how the API doc states. But I’m still getting up to speed on coding with the API directly so this is just a hunch. Maybe the author has some insight @Dimitar_Venkov (think that’s his forum name here) (I believe wrote made Spring Nodes. ) The Building Coder: Place Furniture Instance (
NewFamilyInstance Method (Reference, XYZ, XYZ, FamilySymbol) (
SpringNodes/FamilyInstance.ByHostAndPoint.dyf at master · dimven/SpringNodes · GitHub