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
