Orientation of Floorplans by Room

Hi all, I’m delving into the automated setup of plans, elevations and ceiling plans of rooms. I’m using the CTC Software extension for inspiration as it is a great piece of kit, but I’d like to be able to make my own version to tailor some stuff to my specific requirements (and learn more about Dynamo etc).

Via YouTube tutorials (thanks @GavinCrump!) I’ve managed to generate the required views, but CTC seems to have the brilliant ability to auto-detect the orientation of an angled room and set up the plan & elevations accordingly (see image below). My attempts at generating views just assumes the room is vertical and square.
How would I go about achieving a similar result?

I’ve done this at work and it took a decent amount of Python to do (used pyRevit).

General gist is…

  1. Get all perimeter curves
  2. Find their rotation relative to Y axis
  3. Keep subtracting 90 from this until it is less than 45 degrees
    4 Find the most common angle. Consider weighting the sides by length as well to identify the critical edges
  4. Use this to rotate your elev markers before making the elevations
4 Likes

Did you try using scope boxes to align views?

No. Scope boxes have very little API exposure. How would you use them to automate elevation marker rotation in either case?

Ah I’m still a bit out of my depth with Python. Are there any walkthroughs or tutorials on how to go about this? I’ve had a look through the Module 2 article but the script appears to be broken in Dynamo 2.16.1