Placing af new 3D view on sheet

I have a problem with the placement of a 3D Sectionbox I created from room boundingbox.
I am using a Python Script to place the views. It works with floorplans and elevations. But not with the Sectionboxes. I am not that good at Python, so troubleshooting is a bit difficult for me.


HI @MadsMartiny

by using .Id the element id gets retrieved and output as an integer, but according to Reivt API the element id as an object must be passed to the method.

knowing that, the element id can be easily converted into an object as done in the code.

import clr
from Autodesk.DesignScript.Geometry import *

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager 

import Autodesk
from Autodesk.Revit.DB import *

view = IN[0]
sheet = IN[1]
doc = DocumentManager.Instance.CurrentDBDocument

view_id = ElementId(view.Id)
sheet_id = ElementId(sheet.Id)

OUT = Viewport.Create(doc, sheet_id, view_id, XYZ(0,0,0))

First I actually tried just to remove the line, which created the error, and then copied it back. Then it actually worked.
But I also tried yours and also did the job.
Thanks for the answer :slight_smile: