Set Crop Region Visible to No

Hello everyone,

i am working with a graph that duplicates the views I selected as a dependent, then applies a scope box to the duplicated views. The last thing i would like to do is not working correctly though - set the crop region visible to NO. What am I doing wrong here? :tired_face: Cheers!

test.dyn (33.4 KB)

Hey @bialmeida,

You can try with a Transaction.End node:

1 Like

I read another topic quite similar to mine and that was the other person’s mistake indeed, so I tried to do the same. In my case it doesn’t work because the output I am trying to use is an array (perhaps because i used cross product ?)

would it work with python?

import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
#The inputs to this node will be stored as a list in the IN variables.
views = UnwrapElement(IN[0])

doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)

for v in views:
	v.CropBoxVisible = False
	
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = 0
3 Likes

I think the issue is the lacing and levels. I don’t know your exact dataset but using @L2 with cross-product even though both of the other inputs are only a single element may be messing you up.

1 Like

Sorry, I didn’t notice the cross lacing, as @kennyb6 pointed out.

The attached works for me, but it is only tested with a single view, though.

See if it gets the job done :slight_smile:

test_return.dyn (34.5 KB)

Edit: Just fyi, I implemented a boolean swith in the selection node, to make it easier to “reset”.

1 Like

This is how i wired things up (a bit old school maybe).

1 Like

That works, thanks!

1 Like

That works too, thank you very much!

old School works perfectly! Thanks!

Hello, I am trying to turn off my new Viewport Crop Region using with following script but it doesn’t work.
newViewport.LookupParameter(‘Crop Region Visible’).AsInteger().Set(0)
and also
newViewport.GetParameter(‘Crop Region Visible’)[0].AsInteger().Set(0)
Can anybody give me some help? Thanks