Crop Region by curve

Thanks jup,

Was looking for this… just needed to TAB outputlist.append(view) into the loop

No worries - well I had parked this - been busy since. I’ll check it out though.

Mutually beneficial it would appear :slight_smile:

Hi everyone,
I’m jumping in the conversation about the combine list that I can’t figure it out how to make it work.

@jup : I’m looking at your modification about combine list.
If I’m getting this right, your python as only [0] as entry ?
I tried your python and get this error
" File “”, line 30, in
TypeError: iteration over non-sequence of type FloorPlanView"
(my input in [0] is my list of some dependant view)

@Einar_Raknes at first i used your python code from your dynamo definition and it works great but I still have to select the view one by one.
I tried the zip() - had to rename “curvelist” to “curves” and “views” to “view” and then I get the error :
" File “”, line 34, in
NameError: name ‘outputlist’ is not defined"
Line 34 is the “outputlist.append(view)”

What am I missing there ?

Maybe you have forgotten to define the list?

outputlist = []

THANK YOU !
It works like a charm !

Hey Einar
i try to use the node for multiples views , but i have an error message as shown in capture below

import clr

clr.AddReference(‘RevitNodes’)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *

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

doc = DocumentManager.Instance.CurrentDBDocument

#prepare input
views = UnwrapElement(IN[0])
curvelist = IN[1]
outputlist =

for view,curves in zip(views,curvelist):

#Create curveloop
loop = CurveLoop()
for c in curves:
	loop.Append(c.ToRevitType())

#Set cropregion in Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
view.CropBoxActive = True
view.GetCropRegionShapeManager().SetCropShape(loop)

outputlist.append(view)
TransactionManager.Instance.TransactionTaskDone()

OUT = outputlist

Hi,

If I want to make this script with Areas instead of rooms … that will help me

@Mohamed.Elmasri can you try and see what happens if you replace OST_Rooms with OST_Areas in the code? And if you have any further questions, please start a new thread since this one is old and already solved

Dear Kukul,
I was looking for Script doing same work you sent as a flash. Could you please help.

Thanks.

@kvusal
Please read the forum guidelines to check if you introduced your request appropriately:

Please send also a screenshot of what you tried so far in your initial thread:

Thanks :slight_smile:

Thanx for sharing your knowledge and your script. I used your script but got a warning that the FloorPlanView object is unscriptable. Do I have to edit the script somehow or do I have to change the Input views?

There could be some first clues to be found through the search field:
https://forum.dynamobim.com/search?q=object%20is%20unsubscriptable
See also if the answers already given in this thread can not help, for instance:

Thought the creator of the script would like know the issues, and Yes I searched this thread. Because I did not found the answer, I posted the issue.
Actually I used the View.SetCropBoxCurver from the MEPover package:

hello Kulkul,

what is in the the phyton script you use?

I wood like to copy a crop view in Revit and it seems like You do the with this script in dynamo. And i am curious how You doing that?

kind regards,


i am trying to run the script but.its now working.
and got the error as shown in screenshot.

can any one suggest the change in script