# Problem Setting Crop boxes and Section Boxes in Revit 2022

**URL:** <https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [November 5, 2021, 8:46am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045 "2021-11-05T08:46:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [November 5, 2021, 8:46am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/1 "2021-11-05T08:46:01Z")

</div>

Hi,

I am testing my scripts in Revit 22 and I have a error when I try to set a section box in a 3D view.  
Does someone know what the problem can be?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/6/f6a48e4f04965f43b121bf37f4f7f796ca53a0a8.png)

KG,

Jan Willem

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [November 5, 2021, 3:42pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/2 "2021-11-05T15:42:50Z")

</div>

What is the error you are getting on the Rhythm node? I have it working on my end with an existing 3d view.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/3/1363d5255496cba2d56a90003c7bb4ef22e47539.png)

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [November 6, 2021, 7:34am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/3 "2021-11-06T07:34:12Z")

</div>

Hi John,

Thanks for youre reply.  
The rhythm node give the same error.

Is there something changed in my version and the last version of rhythm?

Kg

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [November 7, 2021, 1:25pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/4 "2021-11-07T13:25:05Z")

</div>

Existing view as showed by @john_pierson and as well new view also working fine… 🙄

 ![3D](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/e/cedbdfa90d831911941d4877b17feeb3ee26fd42.png)

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [November 8, 2021, 6:59am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/5 "2021-11-08T06:59:35Z")

</div>

@john_pierson@_Vijay

Hmm this is strange, this works fine for me too but when I run the whole script he give an error

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/8/88bd22605d0851d9322c3c6823eefc92de9d8794.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/5/d55d62a57891055206d43073db8c5b9c29dfedbb.png)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [November 9, 2021, 4:55pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/6 "2021-11-09T16:55:53Z")

</div>

Woah. that is an error for the new documentation browser…

@solamour is this something ya’ll need to be aware of?

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [November 9, 2021, 7:42pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/7 "2021-11-09T19:42:26Z")

</div>

Definitely appreciate the shotuout @john_pierson! Not sure if this is simply a case we don’t catch (i.e. you had the document browser open, rather than clicking “Read More” on the node in question), or it’s a broken documentation link.

Any thoughts @Michael_Kirschner2?

---

<div class="post-metadata">

**Author:** ![Michael\_Kirschner2](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michael_kirschner2/32/75576_2.png) [@Michael\_Kirschner2](https://forum.dynamobim.com/u/Michael_Kirschner2)\
**Post date:** [November 9, 2021, 9:17pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/8 "2021-11-09T21:17:57Z")

</div>

should be fixed here:

> <https://github.com/DynamoDS/Dynamo/pull/12267>
>
> \### Purpose
> 
> This PR fixes two issues with the documentation browser:
> 1. Dere…ferencingANonePointer exception was mis spelled.
> 
> 
> 2. Sometimes during delta execution warnings will have different expressionIDs assigned for certain nodes that are composed of multiple expressions - like a multi-output node.
> 
> The end result is that the warning text is composed of multiple warnings like:
> 
> \`\`\` Dereferencing null pointer - DereferencingNonePointer.html/n Dereferencing null pointer - DereferencingNonePointer.html/n Dereferencing null pointer - DereferencingNonePointer.html \`\`\`
> 
> The code that parses url's expected that all warning strings would only be composed of a single single url - instead we make the splitting a bit smarter, by also using the same delimiter that is used to join the warnings. 
> 
> This code returns the first url found.
> 
> \###
> TODO 
> \- \[\] tests
> 
> \### Declarations
> 
> Check these if you believe they are true
> 
> \- \[x\] The codebase is in a better state after this PR
> \- \[\] Is documented according to the \[standards\](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)
> \- \[\] The level of testing this PR includes is appropriate
> \- \[\] User facing strings, if any, are extracted into \`\*.resx\` files
> \- \[\] All tests pass using the self-service CI.
> \- \[\] Snapshot of UI changes, if any.
> \- \[\] Changes to the API follow \[Semantic Versioning\](https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Versions) and are documented in the \[API Changes\](https://github.com/DynamoDS/Dynamo/wiki/API-Changes) document.
> \- \[\] This PR modifies some build requirements and the readme is updated
> 
> \### Release Notes
> 
> Fixed a bug where documentation for errors could not be found, or reported illegal characters in the documentation browser.

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [January 24, 2022, 1:43pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/9 "2022-01-24T13:43:41Z")

</div>

Hi John,

I just downloaded you’re last version but I have still the same error.  
Is there a problem in the package or is it a problem by my computer?

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [January 24, 2022, 6:38pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/10 "2022-01-24T18:38:45Z")

</div>

What is the error on the node when you hover over it? You never provided that initially… All you provided was an unrelated error for the documentation browser.

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [January 25, 2022, 7:22am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/11 "2022-01-25T07:22:27Z")

</div>

Sorry for my confusion.  
My bad, I wasn’t clear.

The node give the error: Value cannot be null.  
Parameter name: obj.

When I click on read more the Internal error say his thing about the document browser.

The strange thing is that I have no problems until R2021

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/e/fe128c42b620185ae64bf778713299d90e641d8e.png)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [January 25, 2022, 3:29pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/12 "2022-01-25T15:29:48Z")

</div>

Please ignore the Readmore that is an issue that the dynamo team already replied on…

What are the values you are inputting? It looks like you are feeding the node null values.

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [January 25, 2022, 3:31pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/13 "2022-01-25T15:31:25Z")

</div>

Hi John,

I feed him what he need:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/7/97d76370eb3554619d91981b6db42861bc9bc205.png)

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [January 27, 2022, 10:28am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/14 "2022-01-27T10:28:53Z")

</div>

I am also getting the **ʳʰʸᵗʰᵐ|View3D.SetSectionBox** failure upon upgrade from Revit 2018 to 2022.

**RIE\_Set3DViewSectionBox** also fails.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/e/8e5a166abb06dce4cce622c878f3898a2c241760.png)

This is the Python from **RIE\_Set3DViewSectionBox** :

```auto
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import UIView

clr.AddReference("RevitNodes")
import Revit
# Import ToProtoType, ToRevitType geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

if isinstance(IN[0], list):
	view = IN[0]
else:
	view = [IN[0]]

if isinstance(IN[1], list):
	bbox = IN[1]
else:
	bbox = [IN[1]]

OUT = []
	
for _ in range(0, len(view)):
	curview = UnwrapElement(view[_])
	curbbox = UnwrapElement(bbox[_])
	try:
		TransactionManager.Instance.EnsureInTransaction(doc)
		curview.SetSectionBox(curbbox.ToRevitType())
		TransactionManager.Instance.TransactionTaskDone()
		OUT.append(curview)
	except:
		OUT.append("Failed")
		
	for uv in uidoc.GetOpenUIViews():
		if uv.ViewId.Equals( curview.Id ):
			uiview = uv
		break
	try:
		uiview.ZoomToFit()
	except:
		error = 1

```

What could be breaking it?

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [January 27, 2022, 10:56am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/15 "2022-01-27T10:56:00Z")

</div>

> [@truevis](#):
>
> This is the Python from **RIE\_Set3DViewSectionBox** :

I tried upgrading it to Python3, and that didn’t help.

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [January 27, 2022, 11:03am UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/16 "2022-01-27T11:03:09Z")

</div>

Thank you for sharing this script.  
So it’s not just me.

Right now I use the node from GeniusLoci node.  
After that I set the Type to the one I want and set the viewtemplate.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/4/b443df94b8695a9e0f169403678ac142bd419013.png)

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [January 27, 2022, 2:38pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/18 "2022-01-27T14:38:15Z")

</div>

@jw.vanasselt please send me a sample file that reproduces this issue so I can debug. Screenshots unfortunately are not getting us anywhere with this issue. 😞

If I can’t get it worked out, the node will be removed from Rhythm.

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [January 27, 2022, 3:31pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/19 "2022-01-27T15:31:55Z")

</div>

I have send you a DM 🙂 hope this will help.

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [January 27, 2022, 5:12pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/20 "2022-01-27T17:12:14Z")

</div>

Thanks for the sample files @jw.vanasselt .

Turns out there is some weird error in Dynamo where BoundingBoxes aren’t fully “there” at certain points within a graph and they report as null. This is causing the Rhythm node to trigger with a null value causing errors. I am making an update now that _should_ help.

Please download this release and test it out, it seemed to work on the sample files you sent @jw.vanasselt  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/d/2d7835898ac1e2700199c32c1b9c23e32f95d9aa.png)

The code is here for reference:

> <https://github.com/johnpierson/RhythmForDynamo/blob/4c2182a7b53a6149f1e80566f437693b5b90b7a8/src/Rhythm/Revit/Views/View3D.cs#L31-L62>

---

<div class="post-metadata">

**Author:** ![truevis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/truevis/32/8634_2.png) [@truevis](https://forum.dynamobim.com/u/truevis)\
**Post date:** [January 27, 2022, 6:19pm UTC](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045/21 "2022-01-27T18:19:48Z")

</div>

> [@john\_pierson](#):
>
> Please download this release and test it out

Thank you for the quick update. I am still getting failure in r2022 when r2018 worked.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/3/633e21bb63f10f2ff88b6ac87979ef90fc0b2617.png)

[Next page](https://forum.dynamobim.com/t/problem-setting-crop-boxes-and-section-boxes-in-revit-2022/70045.md?page=2)
