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.