Get elements rotation is always 0

Hi,

Need to find out way I’m not getting the rotation of elements but every element turns up as Zero.
Any clue?


image

Line based elements don’t have a rotation. Try pulling the location curve and get the direction of that as a vector, then get the rotation about the Z axis.

Hi, wich node is that?
Cant find anything with that name

Element.Getlocation i think.

Thanks!!

Is this the way to go?

This cant be right, I’m getting a angle but not a rotation, what I’m missing?

As far as I know, cable trays do not have a rotation. They are a linear element which os places by a line. That line has a direction which you have pulled already. That direction can be interpreted as an angle from another axis, in this case you have that as the angle from the Y axis.

I might not be seeing your end goal as I don’t work with cable trays often, but this feels like mission accomplished based on the original question.

@BIM_Mrbrango

What is the end goal here? are you simply reporting or are you trying to then take the angles manipulate them in some way?

Honestly, i’ve spend a long time draughting services but never have i tried to use dynamo to make major changes to cable tray systems because they misbehave with rotations about the X & Y axis.

If this helps at all, when you have cable trays connected that you want to say, rotate to match the pitch of a roof, then you can do so by correcting a fitting on the end and rotate the fitting to match the roof pitch.

Else, @T_Pover is a wizzard and might know what you are actually trying to do.

I don’t see what that has to do with the element’s rotation…

Hi @jacob.small

You asked what my end goal is.
I still want to deal with different senarios with rotation of cable trays and other MEP setup to make bounding box conform to the angle so I can do collision and free clearance detection.

But I see the mistake I made was not creating a new thread for collision/free clearance detection, which I can agree with.

But the question remains, how can I rotate the bounding box so that they are in line with the installation and do not take up more volume than the installation itself?

That’s not quite related to the element rotation issue, but you can pull the minimum volume bounding box using recent builds of Dynamo for Revit (23 and 24) which should have a BoundingBox.ByMinimumVolume (or similar name). So the workflow would be:

  1. Pull the geometry
  2. Pull the minimum volume box
  3. Test the minimum volume box for intersections
  4. Test the geometry for intersections

Note that geometry intersection tests are required in all cases as you will have round elements and openings in elements neither of which bounding boxes can account for.

Because you still have to do geometry tests, I am not sure how quick this will be compared to:

  1. Get the element’s bounding box
  2. Get all elements in that bounding box
  3. Remove the element from that list
  4. Test the element’s geometry against the geometry of all the other elements

This might help you create rotated bounding boxes.

https://www.google.com/url?sa=t&source=web&rct=j&url=https://m.youtube.com/watch%3Fv%3D5dvl7IHkW0U&ved=2ahUKEwiuz6G7o-j_AhWZ_GEKHYs6AasQjjh6BAgWEAI&usg=AOvVaw2cbdJ3hEoXBYNxAGJdjckI