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.
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)
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
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.
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"
Thatâs nice, does it work for all revit versions?
One would have to test it.
It works in R20 and higher You need to make a custom node with lacing to longest.
Thanks for sharing!
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.
Maybe the inputs have to be lists, not single items.
Try to make the inputs to a list or change lacing to longest
Here is the draft dyn, where I tried different nodes (doesnât work so far)
ViewSectionBoxFromBoundingBox.dyn (48.3 KB)