Sloped ceiling hanger rod length not working

hello, I am trying to write a script to reduce the hanger rod length by the correct distance based on the slope of the ceiling. I had it working but I had to select every starting hanger and second hanger manually. So I tried to speed it up using this springs node. SelectedElements(ordered) to have it work faster. I thought I could get it to work using a while loop but its choking on me. Any advise? thanks!

Your continueWhile input is an open function. Your <= node needs another input.

I still cant get it to work.

I was trying to do what they did in the dictionary.

image

Hmmm… I’m not too familiar with the LoopWhile node so you could be using it correctly.

I don’t know if a LoopWhile node is needed anyway. You have to slope of the roof and the hanger instances, so you should be able to get the location of the hangers and calculate the ΔZ based on the hanger spacing. You could also project the hanger points onto the roof geometry and get the difference in elevation between points.

Yes this is what I am doing. But I am having trouble doing it all for more than two hangers. Any advice, if not with a while loop.

This is very intriguing. How would I do this? Thanks!

Check out Surface.ProjectInputOnto. It will let you project geometry (hanger points) onto a surface (bottom of roof). Then you just compare the z coordinates of the original point to the projected point and get the difference.

1 Like

Hello Nick,

so i tried using the node you mentioned and I read about it in the dictionary but it only appears to work with lines and stuff? I tried using it with my hangers and i got this:

is there a way to get around this?

You have to get the location of the hangers as a point (or line) before you can project it onto the surface. Try Element.Location from Clockwork.

I cant use custom packages. Other than springs it seems like. because It looks like my IT department blocks all DLLs. Is there a way to do it with out clockwork?

You can try Element.GetLocation.

Ok, that works, but I seem to be having a hard time understanding what the point is telling me. I wrote an equation that should work but seeing as it is a level based element, the location in the Z direction is 0 and in the projection it is 546. is that feet? inches? This equation should work based on looking at the family, however the hanger rods shoot straight through the ceiling. What am I doing wrong? Thanks in advance!

I don’t have any hanger families to play with so I’m not exactly sure what parameters we’re working with. Can you send a screenshot of the hanger parameters? I’m looking to see if they have an Offset or if something like Top of Strut/Bottom of Rod will work.

KIT #1 (SS).rfa (724 KB)
Here is the hanger family.I looked at the length it should be and it should be like 408 inches but the projection is like 546. I dont see what the probem is.

Your family is a bit confusing with both level offsets and Top of Strut modifying the element’s location. It would probably be easier if one of these was a reporting parameter.

It looks like the family doesn’t have an actual Rod Length parameter that we can set either. You will have to manipulate the Top Level and Top Offset parameters to get the rod at the correct location.You’ll want to get the elevation of the hanger point intersecting the roof (using Surface.ProjectInputOnto) then set the Top Offset to be at that elevation with respect to the Top Level of the hanger.

Yes, that is correct. Its what I did too. But when I use it to set the Top Offset, it doesnt work. The Rod length parameter is a reporting parameter and so is H. I cant figure out where the descrepancy is though

What about it doesn’t work? Is it not acting as you expected? Is it not being set to the right location?
The offsets seem to work for me the bottom is just controlled by both the Base Level and the Top of Strut.

1 Like

perfect!
Now why wont it let me do multiple items? looks like it is crapping out in the projection node

You’ll have to do a little list management. Try setting the lacing to longest.

fantastic!
Nick youre amazing! would you mind explaining lacing to me in laymens terms please? no matter how many times i read about it, i still dont get it, and I seem to allways be only changing my lacing as a last resort, blindly and iteritively when things dont work but I still dont get it. And ive read everyting on primer about it already. Makes zero sense the way they explain it.