Crop Region by curve

revit

#21

Thanks jup,

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


#22

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

Mutually beneficial it would appear :slight_smile:


#23

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 ?


#24

Maybe you have forgotten to define the list?

outputlist = []


#25

THANK YOU !
It works like a charm !


#26

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


#27

Hi,

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


#28

@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


#29

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

Thanks.


#30

@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:


#31

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?


#32

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:


#33

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: