Problem Setting Crop boxes and Section Boxes in Revit 2022


DYN showing the issue. Thank you for checking.
view set section box test - truevis - revit 2022.dyn (32.5 KB)

.dyn only doesn’t help. This node will be removed from rhythm.

sorry about that.

The summary is, there is some weird bug with the ByCorners node in Dynamo (in newer versions it seems) and I cannot fix it.

Do you think something changed in the 2022 API?

I modified my answer above to help. But in Revit, no, nothing changed regarding setting 3d view crop boxes.

BoundingBox.ByCornerPoints is a node in the Dynamo libraries. Something happened there with the geometry or with the ToRevitType converters here.

At this point the node will be removed from Rhythm and that is all the remaining comments I have at this time.

I am revising the title of this thread to better represent the future goal. Also, please feel free to start a new thread if that works better for you.

I wish you all the best of luck in making this work with other packages/nodes.

1 Like

Here is a workaround for making a View with a specific orientation and SectionBox in Revit 2022:


Result:

The Python from 3DView Set Orientation or 3DView by BoundingBox could be changed to not need the “Control View” and just make an orientation to make it slicker. Thanks to @jw.vanasselt for the GeniusLoci clue, and all y’all for looking at this issue.
view set section box workaround - truevis - revit 2022.dyn (41.7 KB)

2 Likes

Thank you for you’re support John.
Pity that this node will be removed but unfortunately it is no different.

@truevis thanks to you too :slight_smile:

I hope someone clever with Python can combine 3DView Set Orientation or 3DView by BoundingBox and make it work without having to make a View just to set the orientation.

2 Likes

AxonometricView.ByEyePointTargetAndboundingbox is also broken with what looks like the same error as the Rhythm node.

That’s weird, do you think this is a dynamo 2.12 problem?

I found a node/python that works! The code came from package Zhukoven.com node BoundingBox.ToSectionBox. I just changed its output a little.
view create set section box w orientation alternative solution - truevis - revit 2022.dyn (24.7 KB)

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

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

doc = DocumentManager.Instance.CurrentDBDocument
bbox = IN[0]
view = UnwrapElement(IN[1])
try:
    TransactionManager.Instance.EnsureInTransaction(doc)
    newmax = UnwrapElement(bbox.MaxPoint).ToRevitType()
    newmin = UnwrapElement(bbox.MinPoint).ToRevitType()
    newbox = BoundingBoxXYZ()
    newbox.Max = newmax
    newbox.Min = newmin

    z = view.SetSectionBox(newbox)

    OUT = view
except:
    OUT = "Error"
1 Like

That’s nice, does it work for all revit versions?

One would have to test it.

It works in R20 and higher :slight_smile: You need to make a custom node with lacing to longest.

Thanks for sharing!

1 Like

See ViewSectionBoxFromBoundingBox from truevis for new node.
image

3 Likes

I had the same problem, didn’t get it to work with the truevis node either - what worked, was creating a cuboid out of the section box and then converting back to a section box again. Might be worth a shot for someone, even if it’s a dumb solution.

3 Likes

Doesn’t work

Maybe the inputs have to be lists, not single items.

Try to make the inputs to a list or change lacing to longest

No luck so far…

Here is the draft dyn, where I tried different nodes (doesn’t work so far)


ViewSectionBoxFromBoundingBox.dyn (48.3 KB)