Changing Line weight for Crop Region of elevations

Hello,

I am working on improving my firms coding and I have hit a snag. I am new to Dynamo but do have a little experience with coding. We have a script that changes the line weights of the interior elevations to level 06 but the issue was that all elevation views would change and any view that had its crop region turned off would turn back on. I have worked around the issue of masking only the elevation views with their crop region on, but now I can’t get the last part of the script to run. It gices me a “Dereferencing a non-pointer.” error and I don’t know what that means or how to fix it. I was thinking that I need to convert the node into a different category like a list to an element but nothing has been working. Any Ideas on whats going on and if there is a fix or a better solution? I am using the Archi-lab.net package.

You’re feeding the name of the view into the override crop node, feed the view in before the element.name node instead.

I don’t know why I missed that but It is still giving me the same problem. This time the warning states "Unable to cast object of type ‘Autodesk.Revit.DB.Element’ to type ‘Autodesk.Revit.DB.View’.

What exactly does that mean? Do I need to convert the Element data into a View data for it to work?

Are those elements views? The node is asking for those but it looks like you might be getting the crop boundary.

Okay, so how should I re-work this so that it calls out the views while still filtering by if the crop region is active?

The only change to make is to send the views to the filterbyboolmask instead of their crop region element. Filter them by if they have crop visible still though.