Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Scripts/rhinoscript/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,12 @@ def ObjectLayer(object_id, layer=None):
scriptcontext.doc.Views.Redraw()
return rc

# C Sykes 4th Jul 2026
# RH-96724 rs.ObjectLayout(obj) moves objects
# Do not move the object to model space when no override is given
__unset = object()

def ObjectLayout(object_id, layout=None, return_name=True):
def ObjectLayout(object_id, layout=__unset, return_name=True):
"""Returns or changes the layout or model space of an object
Parameters:
object_id (guid): identifier of the object
Expand Down Expand Up @@ -964,7 +968,7 @@ def ObjectLayout(object_id, layout=None, return_name=True):
rhobj.CommitChanges()
scriptcontext.doc.Views.Redraw()
else:
if layout:
if layout and layout is not __unset:
layout = scriptcontext.doc.Views.Find(layout, False)
if layout is not None and isinstance(layout, Rhino.Display.RhinoPageView):
rhobj.Attributes.ViewportId = layout.MainViewport.Id
Expand Down