Aligning elevation/section to model element

I have a situation where a portion of my project is rotating in small degree increments, when this happens my elevations and section need to be re-positioned to account for the rotation. Ideally, I would like to create a line and then align my elevation/section to that line. I reviewed the below post and the graph seems to move the section, but it does not rotate it into proper position.


Any thoughts would be appreciated.

I don’t know how to programmatically rotate them, but I can think of a partially scripted work around.

Get the wall using a select model element node, then use a element location, pull the start and end points and make a vector by those points.

Set the view using a select model element node, use the view.plane node (clockwork I think) to query the plane of the view, and get its normal.

Use an angle about axis node to get the angle between the two vectors.

If the angle is > 180 subtract 180 with a code block like RotationAangle > 180? RotationAngle-180:Rotationangle

If it is a section view add 90 with a similar code block or set of logic nodes. If it is an elevation leave it as is.

Copy that angle to the clipboard with a clipboard send to node and manually rotate the view by the given angle. This last part stinks to have to do, but short of pyton script using the API function to rotate a view (if such a thing exists) I don’t have any other ideas at the moment.

View_ElevationAlignToElement.dyn (85.0 KB)
View_SectionAlignToElement.dyn (92.1 KB)

I know this post is old, but these two scripts should work for align elevation to wall, and set section 90deg to wall. They both work in Dynamo 2.0 and works best with dynamo player :slight_smile:

3 Likes