Problem Setting Crop boxes and Section Boxes in Revit 2022

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?

KG,

Jan Willem

1 Like

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

image

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

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

@john_pierson @_Vijay

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

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

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

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?

should be fixed here:

1 Like

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?

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.

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

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.

Hi John,

I feed him what he need:

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

RIE_Set3DViewSectionBox also fails.

This is the Python from RIE_Set3DViewSectionBox:

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?

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

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.

1 Like

@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. :disappointed:

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

1 Like

I have send you a DM :slight_smile: hope this will help.

1 Like

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

The code is here for reference:

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