Place existing view on existing sheet issue [null]

I read several threads about problem of placing views on sheets but none seems to help me. I wanted to do simple thing for start - get a specific sheet and place a specific view on it. No luck… :frowning: I get null output - anyone knows what’s going on here?

Hi,

Quick questions :

  • Are you in Manual mode ? If so, have you hit Run ?
  • What version of Dynamo are you using and which version of Dynamo is supported by this package ?
  • Could you try to copy and paste the content of the custom node in your graph and running it ? It may help to see where the problem is encountered.

Yes, I did run it. 1.3.2

#python nodes in dynamo 1.2
#proposed by Julien Benoit @jbenoit44
#http://aecuandme.wordpress.com/
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

sheets = []
for i in IN[0]:
sheets.append(UnwrapElement(i))
views=[]
for i in IN[1]:
views.append(UnwrapElement(i))
points=[]
for i in IN[2]:
points.append(UnwrapElement(i).ToXyz())

# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
viewport=[]
for s,v,p in zip(sheets,views,points):
try:
a=Viewport.Create(doc, s.Id,v.Id, p)
except:
a="View is already placed"
viewport.append(a)

# End Transaction
TransactionManager.Instance.TransactionTaskDone()

OUT=viewport    

sheetplace.dyn (11.0 KB)

Sorry, maybe I was unclear. Can you paste this Python script on your .dyn and directly connecting the inputs to it ? The Python node will certainely output an error and we will see where it is bugging :slight_smile:

Ok, to be sure - I placed Python node, pasted the code there and added two more inputs.

The error I get is:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 30, in
TypeError: iteration over non-sequence of type Sheet

p.s.

Does it mean it expect lists?

p.p.s.

Ok, so I created lists for input but now I get no error and no effect :smiley:

That would also be my guess :slight_smile:

Is the Python node still returning null ? Or returning an empty list or something ?

My fault - I tried to place view already placed on sheet! BUT I then decided to place a schedule which can be placed on multiple sheets and still get the same message. Will try to create a specific new view to test it.

p.s.

It went fine with newly created view but I wonder why Schedule didn’t work.

1 Like