The View Sheet node and Revit 2013


#1

I have a project in R2013 that has ~50 views that will need to be put on sheets. I was hoping that I could use some Dynamo magic to speed things up. But unfortunately when I try to use the node, I get the following error:

Method not found: ‘Void Autodesk.Revit.DB.Viewport.SetBoxCenter(Autodesk.Revit.DB.XYZ)’.

I know the problem isn’t in the node because it works in R2014 projects. So am I guessing correctly that the older version of Revit doesn’t support this functionality?

I will need to submit this one in the older R2013 version, so I was wondering if there’s a way to recreate that node’s functionality in R2013.

From Revit2013’s API, it looks that it needs xyz coordinates to place the view. Maybe the node needs a different syntax for the older version?

public static Viewport Create(
	Document document,
	ElementId viewSheetId,
	ElementId viewId,
	XYZ point
)

#2

Just a quick update for anybody who’s in a similar predicament.
It seems that for R2013 you need to generate the empty sheets first and then populate them with views afterwards. So to counter this two step process I used 2 separate dynamo definitions. Unfortunately my python-fu isn’t there yet to be able to fit them into a single definition.

Both of the nodes are very project dependent and need some tweaking, so it’s not a very automated process.

The first one uses a one simple python node to generate sheets and needs only the current doc, the TB family id and the number of sheets:

Then it changes the sheet params afterwards.

The code is:

# Default imports
import clr
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)
from Autodesk.Revit.DB import *
import Autodesk
import sys
import clr
path = r’C:\Autodesk\Dynamo\Core’
exec_path = r’C:\Autodesk\Dynamo\Core\dll’
sys.path.append(path)
sys.path.append(exec_path)
clr.AddReference(‘LibGNet’)
from Autodesk.LibG import *
clr.AddReference(‘DynamoPython’)
clr.AddReference(‘DynamoCore’)
clr.AddReference(‘DynamoUtilities’)
clr.AddReference(‘DynamoRevit’)
import Dynamo

#The input to this node will be stored in the IN0…INX variable(s).
doc = IN0
titbl = IN1
total = IN2
count = 0
result = []

t = Transaction(IN0, ‘new transaction’)

t.Start()

while count < IN2 :
onest = ViewSheet.Create(IN0,IN1)
result.Add (onest)
count = count + 1

t.Commit()

#Assign your output to the OUT variable
OUT = result

The second definition takes the ids of the sheets and views and you need to generate some x and y coordinates for placing the views. If your views are in a different scale, then it gets a bit tricky.

 

# Default imports
import clr
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)
from Autodesk.Revit.DB import *
import Autodesk
import sys
import clr
path = r’C:\Autodesk\Dynamo\Core’
exec_path = r’C:\Autodesk\Dynamo\Core\dll’
sys.path.append(path)
sys.path.append(exec_path)
clr.AddReference(‘LibGNet’)
from Autodesk.LibG import *
clr.AddReference(‘DynamoPython’)
clr.AddReference(‘DynamoCore’)
clr.AddReference(‘DynamoUtilities’)
clr.AddReference(‘DynamoRevit’)
import Dynamo

#The input to this node will be stored in the IN0…INX variable(s).
doc = IN0
sheetid = IN1
total = IN2
viewid = IN3
position = IN4
count = 0
a = 0
result = []

t = Transaction(IN0, ‘new transaction’)

t.Start()

fview = Viewport.Create(IN0,IN1[0],IN3[0],IN4[0])
result.Add (fview)
count = count + 1

while count < IN2 :
a = a + 1
sview = Viewport.Create(IN0,IN1[a],IN3[a],IN4[a])
result.Add (sview)
count = count + 1

t.Commit()

#Assign your output to the OUT variable

OUT = result

 

2014-06-23_101529 2014-06-23_101816

 


#3

Dimitar,

 

Do you have the full size of the second image you included? I can’t get the blow up of that one.

 

Best,

 

Kevin