Hello Dynamo Friends
I´m looking for the API-Method to get and set the view title location. Google and RevitAPIdocs didn´t help me
Rhythm has this nodes:
But I want to do it in python.
Happy about any help
Kind Regards!
Hello Dynamo Friends
I´m looking for the API-Method to get and set the view title location. Google and RevitAPIdocs didn´t help me
Rhythm has this nodes:
But I want to do it in python.
Happy about any help
Kind Regards!
Does this help?
Hello Jan,
Can you tell me what the “label” is ? Is the label the title? Then the labeloffset is what i want?
Sorry I don´t know this english term.
I think you can use the def what John use in this code.
Thank you Jan!
Setting the Viewtitle works, somehow:
As you can see in Dynamo background the outline and as a result the viewtitle is WAY off.
Will have to find out why and i have to find out how to GET the title location.
outlist=[]
# If Input is an item wrap it in a list:
if isinstance(IN[0],list):
viewports = UnwrapElement(IN[0])
else:
viewports = [UnwrapElement(IN[0])]
TransactionManager.Instance.EnsureInTransaction(doc)
for viewport in viewports:
outline = viewport.GetBoxOutline()
maxpoint = outline.MaximumPoint
viewport.LabelOffset = maxpoint
TransactionManager.Instance.TransactionTaskDone()
OUT = viewports
Got it! New location is maxpoint-minpoint
outlist=[]
# If Input is an item wrap it in a list:
if isinstance(IN[0],list):
viewports = UnwrapElement(IN[0])
else:
viewports = [UnwrapElement(IN[0])]
TransactionManager.Instance.EnsureInTransaction(doc)
for viewport in viewports:
outline = viewport.GetBoxOutline()
minpoint = outline.MinimumPoint
maxpoint = outline.MaximumPoint
viewport.LabelOffset = maxpoint-minpoint
TransactionManager.Instance.TransactionTaskDone()
OUT = viewports
And here is the code for getting the viewtitle location:
outlist=[]
# If Input is an item wrap it in a list:
if isinstance(IN[0],list):
viewports = UnwrapElement(IN[0])
else:
viewports = [UnwrapElement(IN[0])]
for viewport in viewports:
location = viewport.LabelOffset
outlist.append(location)
OUT = outlist
And this is for setting title to top left:
outlist=[]
# If Input is an item wrap it in a list:
if isinstance(IN[0],list):
viewports = UnwrapElement(IN[0])
else:
viewports = [UnwrapElement(IN[0])]
TransactionManager.Instance.EnsureInTransaction(doc)
for viewport in viewports:
outline = viewport.GetBoxOutline()
minpoint = outline.MinimumPoint
maxpoint = outline.MaximumPoint
topright = maxpoint-minpoint
viewport.LabelOffset = XYZ(0,topright.Y,0)
TransactionManager.Instance.TransactionTaskDone()
OUT = viewports