My goal is to have our King Stud family that gets loaded from our server into an architecture file and placed at each door in the project. I need it to match the door width, match the floor to floor height and match the rotation of the wall/door that it is placed around.
I have been able to piece together enough code to get my program to work, but am stuck on the last two items. I have managed to load the family, query the doors, apply the location and the width. I can’t figure out how to tackle the rotation and the Level to Level (by instance) problem.
If you can select one of the faces of the door panel you can get its normal. You will need to add vector to your frame (whether it be in the family or dynamo) in the direction someone would walk through it. Then measure the angle between the door panel normal and the vector. That will give you the rotation angle.
However you add the vector to your frame you can do the same to the door instead of finding the panels normal.
You could also draw a line or vector (in dynamo) from king-stud to king-stud and door jam to door jam and measure the angle of those to lines.
So, I have been able to grab the location of the doors, insert my family at that location, grab the door width, grab the door rotation, but I can not correlate the lists so that the same location also matches the width and rotation. Instead I get random application of my found parameters to the new families. I think it’s related to list combinations, but can’t sort it.
Well I rewrote the program from scratch and got everything except height to work this time. However, I have two issues that arise from messing with the model a bit.
Curtain wall doors mess with Dynamo and cause an error. My small test project doesn’t get affected, but a larger file crashed. I assume due to this. I need to see if I can eliminate Curtain wall doors from the list of doors.
Modifying the walls connected in my test model doesn’t affect the performance, but adding a new unconnected wall messes with the rotation portion of the program. It’s only for non-orthagonal walls with a door that Dynamo does something odd. Thoughts?
Try looking at this post. He was not able to get it 100% of the way there but seems like it might help you.
To filter out the curtain wall doors get the element names of all door search the list to see if it contains “Curtain” (or something in the name) and run that and the list of doors trough a boolean mask
David-I’m after the EXACT same thing! Not sure if you ended up figuring this thing out. If not, I’m going to continue working through what I’ve got and see if I can’t get the rotation to work. I’ll post a graph if I’m successful! Are you working for a GC? Drywall/Framer?
I’ve got OTB door families loaded but for some reason it’s not pulling the Width parameter? Any thoughts? I switch to walls and am able to grab the length.
I’m not sure why but Element.GetParameterValueByName wasn’t working. Element.Type worked. Things like this make NO SENSE to me. The only reason I tried Element.Type was by browsing through the forums. What’s the best way to understand things like this? Is it based on updates from Dynamo?
For whatever reason this graph only places one instance of the King Stud family. It’s pulling the location of all three doors. Why is it not placing at all three locations? The rotation I’ve yet to really dig into…