When applaying parameter to crop view and crop region vissible it turns the value of the scope box to read only

I created a dynamo script for creating crop view for the plan views, section and elevation views

When applaying parameter to crop view and crop region visible it turns the value of the scope box to read only

Why?

I ran into the same thing recently and found this:

You’ll have to reset the crop on all the views to be allowed to apply a scope box again.

1 Like

Thanks Amy

Reset crop solves the problem

It is strange that it happens because I use a rectangle to make the crop view
it will probably have something to do with the precision of the values of vertices

is it possible to carry out reset crop with dynamo for all views?

Yeah I experienced it with rectangles as well; I couldn’t reproduce the results by drawing a new rectangle in any way in Revit so you might be right about precision. Unfortunately, the Reset crop method doesn’t appear to be exposed to the API from what I can tell: http://www.revitapidocs.com/2018/23549769-0715-f39b-7083-86f1902bd8a8.htm

As a workaround, you could develop a script that will set the crop region based off of Scope Box geometry, but that’d require the script to be run again if the scope boxes or crop regions are modified afterward so isn’t ideal.

Hello Amy

The reset Crop is exposed in the API:

TransactionManager.Instance.EnsureInTransaction(doc)

for v in view:
	if v.CropBoxActive == True:
		a = v.GetCropRegionShapeManager()
		a.RemoveCropRegionShape()

TransactionManager.Instance.TransactionTaskDone()

Nico