Apply Scope Box to Specific Views


#1

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 (12.3 KB)

Thanks.


Applying a list of scope boxes to a list of floorplan views
Apply Scope Box to Views - specific views
#2

Pretty straight forward parameter setting. Just make sure you give the scope box element, not the name.


#3

I’m get Null results at the Element. SetParameterByName.


#4

Can you show the error?


#5

If your Revit parameter is a YES/NO parameter (infered by your use of false), you need to input an integer, not a boolean. In Revit it uses 0 = False, any other integer = True. If this is the case, set the value to 0 and it should work. The other issue, at a guess, is possibly caused by a View Template assigned to your active view.

EDIT: True and False will also work! There’s only one error to resolve…


#6

So, I made a couple edit. I’m almost getting the results I need. Still at the end it goes null.
APPLY VIEW TEMPLATES TO VIEWS 2.dyn (11.6 KB)


#7

What view are you using?
I only used ActiveView as an example. You need to pass the correct view into SetParameterByName. I’m guessing you’re active view can’t take a scope box.


#8

@timmyt21, this works for me:


The first SetParameterByName sets the scope box, the second one turns off the crop region.

(Added): it turns out that when you modify the sketch of your crop region, the Scope Box parameter becomes read-only. This is why some views return the “null” values.


#9

This string gives an error at the list.getitemallindex node.


#10

I’m trying to apply the “Area A” scope box to all dependent views that have “Dependent 1” in the view name and turn off the “Crop Region Visible” parameter for the views. Everything works great until the first “Element.SetParameterByName” node.


#11

@timmyt21, Get Item At Index expects the Number, not the String: remove the quotes from the input (“0”)
I’m talking about this guy:


#12

You’re also feeding the view name into the SetParameter node, not the actual element. You want to use FilterByBoolMask on the AllElementsOfType node.


#13

This part of your code doesn’t work, because you’re using the wrong input.


#14

YES! Thank you. That seems to have fixed the issue.


#15

Gah, new job linked to my autodesk account! Not right! Oh well, lol

I’m working on setting some scope boxes as well, but on my Element.SetParameterByName, I keep getting “Parameter Storage Type” is not a string when I try to write my Scope box names to the “Scope Box” parameter, not sure why as the examples above are doing the same thing.


#16

feed scopebox into the value. it should work