Previous script (project onto surface) not working any more

hello, I have a script that i wrote that was working fine yesterday but suddenly decided to stop working today. I tried to make it much more elaborate, but then traced the problem back all the way to the original script. which was working fine to begin with. Now, when I try to run it the project onto surface node is crapping out on me. Does anyone know why that could be? Does it project in both the +Z and -Z directions simultaneously looking for the plane? or do I have a levels issue somewhere? Cheers!

No, it doesn’t. It only projects in the specified direction

In your case, the problem could be …

  1. The surface is below the point that is being projected
  2. The point lies beyond the extents / boundaries of the surface

Well it is not the projection that is the problem. As you can see below. the projection points are showing up as they should on the surface of the ceiling. However the hanger rod lengths are not being set properly.


the elevations from the projection points are all different, however, when the elevation of the level is subtracted from the projected Z point, it somehow comes up with all the same answers, which is impossible. What gives? Is this a lacing issue? I am attaching the two hanger families that I am trying to get this to work with. Cheers!


J hanger Family.rfa (1.0 MB)
KIT #1 (SS).rfa (1.5 MB)

It looks like it’s your list structure. Flatten your level elevations before subtracting them from your reference points.

Ok that looked like it helped, as the numbers are calculating properly, but they are not setting the hangers properly. It is still making all the hangers the same length…??

It’s the same thing again. Look at your list structure. Your elements are in a 3-dimensional list and your parameter values are in a 2-dimensional list. You’re setting a single parameter so it’s easiest if you just flatten both your lists.

Thanks!
Now any Idea why the hangers are not coming in rotated properly on conduit drawn at an angle?

this node seems to be malfuctioning. However it does work with conduit drawn at 90Âş increments. Cheers!
image

What are you trying to do there exactly?

rotate the hanger to match the orientation of the pipe.

But you’re just checking the rotation of all the pipes to the rotation of all the hangers. You need to sort the hangers by pipe so that you can check them against the specific pipe they follow. And you need to make sure your list structure is correct.

I am setting the angles to the pipes it just isnt working for intermediate angles. See below where I get pipe vectors and find the angle between them and their corresponding pipes. Should I use cross product lacing here?

But you’re comparing 4 pipe vectors to 52 hanger vectors. You’re correct in that using cross-product lacing will compare each pipe vector to each hanger vector, but then how do you know which of the 4 angles to use for each hanger? You need to find out which pipe each hanger is supporting so that you can compare that specific pipe vector to each of the hangers supporting it.

EDIT:

What I have to say about that is that the hangers are orienting like they are trying to orient to the right pipe already. If i make 90 degree turns with my conduit my hangers will rotate 90 deg correctly on the correct segment. The ones that are at obscure angles will rotate, however not the right amount. It is almost like the inverse or something that they are rotating. Like they are rotating by the right number of degrees but in the wrong quadrant. I think it works because of the ordering of the placing of ponts on the line that the hangers know which pipe the are orienting to. I just need to be able to correct the ones that are angled at like 22 deg and stuff

Can you please explain to me why you are masking at the second level here? also, how do you get the same results with out using this element.location node (I cant get clockwork) Thanks!

Gotcha. I think it depends on the direction of the line, whether the vector is positive or negative - something like that. If you redraw your conduit in the opposite direction I’ll bet it will rotate properly.

If that’s the case you’ll have to do a check before rotating your hangers. If the vector is positive you’re good, if it’s negative you rotate by the supplementary angle (I think, or maybe the complimentary… however the math works out :wink: ).

1 Like

yeah, but how do I go about doing that? I dont know how…Please advise.

EDIT: I originally said it was due to a positive Y value but because it’s the normal it’s actually dependent on a positive X.

This will get you the vector of the line:
image
It seems like a positive X value returns the correct normal and a negative X returns the supplementary angle.

So if X is positive, rotation = normal.
If X is negative, rotation = 180 - normal.

That should be enough to get you started.

Just to make sure I follow. Dont you mean if x is positive or negative, not Y?

Yup. Just made the change as I saw your post.

Why doesnt the element.curves node work with conduit