Views.SetCropBox throws - "Value cannot be null. Parameter name: obj." Error

Hi,
I’m trying to move the cropbox region in a view and as the title says, Views.SetCropBox throws - “Value cannot be null. Parameter name: obj.” Error.
I tried recreating the node in python script, changing to Transaction.Commit() and it throws the same error.
It is not because of the list levels, I’ve also tested it in numerous scenarios and is always the same error.
Any ideas?

Thanks,
Luka

Hi,

Try to use a transaction end.
Which Revit version do you use?

I know in 22 there is a problem with views/boundingbox:

1 Like

thanks for the response.

If you’re referring to Transaction End built in Dynamo node, that didn’t work.
Yes, it is 2022.

Is there any other way to achieve this?

managed to get it to work via archilab’s View.SetCropBoxCurves.
but still curious why Views.SetCropBox is throwing that error so I’d appreciate if someone can share the knowledge.

Thanks

See also:

My first try reporting a Dynamo bug on Github seems to have gone nowhere. But as all Autodesk customers eventually learn, we find workarounds and proceed without dwelling on the bugs for too long.

1 Like