# Floor plan from Scope box

**URL:** <https://forum.dynamobim.com/t/floor-plan-from-scope-box/35053>\
**Category:** Revit\
**Created:** [April 19, 2019, 11:21pm UTC](https://forum.dynamobim.com/t/floor-plan-from-scope-box/35053 "2019-04-19T23:21:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tainted](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@Tainted](https://forum.dynamobim.com/u/Tainted)\
**Post date:** [April 19, 2019, 11:21pm UTC](https://forum.dynamobim.com/t/floor-plan-from-scope-box/35053/1 "2019-04-19T23:21:37Z")

</div>

Hi everyone,  
I got this python script posted by Dimitar Venkov and Konrad Sobon which basically creates a 3D view by bounding box.

```
import clr
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

def tolist(obj1):
    if hasattr(obj1," __iter__"): return obj1
    else: return [obj1]

bboxs = tolist(IN[0])
viewNames = tolist(IN[1])
views=[]
#get ViewFamilyType for a 3D View
collector = FilteredElementCollector(doc)
viewTypeColl = collector.OfClass(ViewFamilyType)
for i in viewTypeColl:
	if i.ViewFamily == ViewFamily.ThreeDimensional:
		viewType = i
	else:
		continue

for bbox,viewName in zip(bboxs,viewNames):
	newmax = UnwrapElement(bbox.MaxPoint).ToRevitType()
	newmin = UnwrapElement(bbox.MinPoint).ToRevitType()
	newbox = BoundingBoxXYZ()
	newbox.Max = newmax
	newbox.Min = newmin
	
	TransactionManager.Instance.EnsureInTransaction(doc)
	view = View3D.CreateIsometric(doc, viewType.Id)
	view.Name = viewName
	view.SetSectionBox(newbox)
	views.append(view)
	TransactionManager.Instance.TransactionTaskDone()

OUT = views

```

I am not familiar with Python or Revit API (learning it ATM) so need some help figuring this out.  
Is there anyway someone can modify the script to have it create a floor plan view instead of a 3D view from the bounding box or something similar to a box?

For example, I want the user to go to an already existing floor plan view, create a scope box around an area and finally crop out everything else that is not inside the box.

You can also help me by pointing me to the right direction. I will appreciate all the help I can get.

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [April 20, 2019, 1:32am UTC](https://forum.dynamobim.com/t/floor-plan-from-scope-box/35053/2 "2019-04-20T01:32:46Z")

</div>

Could try here and use a scope box for the Views.

> [@Apply Scope Box to Specific Views](https://forum.dynamobim.com/t/apply-scope-box-to-specific-views/12601):
>
> I’m trying to apply a scope box to specific views. Actually, in the end it would be nice to be able to have all my views to automatically get scope boxes applied to them. Also, I need the script to also turn off the “Crop Region Visible” parameter as well. I have gotten to the very end of this. But, its shooting back NULL at me with no results. Any direction would be great. Attached the dyn file. [APPLY VIEW TEMPLATES TO VIEWS.dyn](https://forum.dynamobim.com/uploads/short-url/iQd623YvfiKCyscSmp4hLeLjV9B.dyn) (12.3 KB) Thanks.
