Possible to control Viewport Title position?

Just found that Revit 2022 has added “LabelOffset” as property to Viewport.
https://www.revitapidocs.com/2022/d2856541-4f08-f212-99b3-0eee98bdb43c.htm

So can we do something like this to control it’s position?
圖片

if isinstance(Viewport, DB.Viewport):
Centerpoint = Viewport.GetBoxCenter().ToPoint3d()
Viewport.LabelOffset(50,50,50)
elif Viewport == None:
show_remark(“Please connect a DB.Viewport Element to the input.”)
else:
show_warning(“Please connect a DB.Viewport Element to the input.”)

Here something to get you started.

RIR-ViewportLabelOffset.gh (11.0 KB)

As always, thank you very much @Japhy .

Something curious:

  1. What is the unit for XYZ? I thought that is the same as document unit?

  2. This one has been bothered me for a long time…
    What is exactly define the “Viewport” boundary?
    It seems to have a specific offset distance from crop region but don’t know where to control.

The offset is from the bottom left of the Crop Region. If there isn’t a crop region active it goes from the 100x100 default in this example.

Revit Internal Units are always going to Decimal Feet.

Hi Japhy,
Can I choose the viewports properties? For example, I want the legend to have no title.

In the Revit UI you select and edit the Viewport System Family Type. The Type contains the settings as well as the Title parameter

Get and set Type Parameters with the Element Parameters Component.

I can query the type parameters, but they are read-only.

Not seeing anything unusual here, can you provide more details on the issue you are seeing?

I don’t want to directly adjust the internal parameters of the type; instead, I want to adjust them by selecting the type name.Otherwise, it will affect the titles of other views.

Uploading: 8b5cd42ecad5ae31d99f1278a572680.png…
By selecting the types in here, but they are read-only. Could it be that there is an issue with my operation?

Your image didn’t post.

Switching out the Viewports Type or Modifying the Viewport Types Title parameter isn’t read only.

Oh, thank you. I should select the type in the Element Type component.