I am trying to orientate a number of 3D views with names containing L01 to a floorplan view with the name containing L01. I started off with the graph and python script that Ben Osborne wrote a couple of years ago. http://dynamobim.org/forums/topic/view-orientation-and-python-script-refresh/
It also looks like a number of people have been looking for some sort of solution to this.
I am currently stuck with an error:
Basically saying that ‘ViewPlan’ does not have an attribute for ‘GetOrientation’.
@jraiten Ok I just had a better look at this - when I checked out your python error / code yesterday I was focusing on the error on the Python node (sorry for replying without looking more closely). You’re feeding the code a plan view, when it is expecting a 3D view. These lines will not work with the view or views you’re trying to input because these lines are calling attributes of the View3D Class, the views you are inputting belong to the ViewPlan class:
I recommend making one 3D view oriented to plan view, and inputting that as your control view (the IN[0] input), rather than inputting a floor plan view and having to modify that code.
Also, this part of your graph is not actually resetting anything on your graph:
@Dimitar_Venkov included that in the forum post you linked in your original post to show how implementing a boolean into a Python script works. If you edit the Python code you will see that it is just displaying a random number when you run the code. If you set the boolean to false, the random number will not regenerate, aka the code will not run.
import clr
clr.AddReference('DSCoreNodes')
import DSCore
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
#This will generate a random number every time you toggle the Boolean and run the graph.
OUT = DSCore.Math.Random()
for i in controlview:
viewSetting = i.GetOrientation()
i.SaveOrientationAndLock()
I created a new 3D view (X01_SET) to set the other 3D views to.
I changed the code to reference the 3D Set View, and it looks like my output is correct. with no error.
I realize now it actually did complete, but the only thing it did was Lock each 3D view.
@awilliams,
In Revit, I would go to a 3D view and “right click” on the view cube and select “Orient to View” and select a floor plan view. Which in-turn takes the limits of the plan view and assigns it to the section box of the 3D View.
So in Dynamo, yes, it looks like I want to change the section box of multiple 3D views and assigned them from a Plan view (or a single 3D view)
@jraiten@awilliams I am looking for the same solution, I would like to orient the 3D views to a southeast isometric view with Dynamo. It sounds simple but I don’t find the way to do it.