Additional functionality to ObjectAttributes.ViewportId

Hey @wim,

In my opinion, you added some extremely useful commands here, thank you!

Do these actually make use of ObjectAttributes.ViewportId under the hood?
I was testing with that functionality (via Rhinocommon) before and thought it would open up so many possibilities if the system allowed an object to show up in multiple Viewports as well, not just a single one. I tried a comma deliminated list of Ids in ObjectAttributes.ViewportId but unfortunately that didn’t work…
One would be really free to setup different viewports with different combinations of objects - which now is a bit limited as one object can only show up in one certain viewport.

Do you think the existing functionality could be extended in such a way? Or could you maybe forward me to someone to talk to about this idea?

Maybe an inverted functionality would be useful as well - a list of Viewports in which the objects should stay hidden.. That would open up all possibilities of filtering objects in certain viewports.

Very interested to hear what you think about these ideas! Thank you!

Hey Romuald -

Under the hood, the code allows for multiple viewports. There is a request on the list to expose this in the UI:
RH-89968 IsolateToViewport: Allow Visibility in Multiple Viewports

I’ve put your RhinoCommon request on the list:
RH-89977 Per-Viewport Visibility: RhinoCommon Access
-wim

1 Like

RhinoCommon in the latest WIP already has support for all of this.

These are the new functions available on ObjectAttributes to let you define where objects “exist”

public bool GetActiveInViewportOverrides(out Guid[] viewportIds, out bool active)

// Specify that an object "exists" only in a specified set of viewports
public bool SetActiveInViewportOverrides(Guid[] viewportIds, bool active)

// Checks if the specified viewport has an activity override
public bool HasActiveInViewportOverride(Guid viewportId, out bool active)

// Adds the specified activity override to the specified viewport
public bool AddActiveInViewportOverride(Guid viewportId, bool active)

// Removes the specified activity override to the specified viewport
public bool RemoveActiveInViewportOverride(Guid viewportId, bool active)

Objects are either “active” in a certain set of viewports in “inactive” in a certain set of viewports.

2 Likes

Wow, thank you @wim and @stevebaer, that’s like chrismas and birthday at once!
Great addition to the system, I will definitely use this a lot!!
Thank you!