Set Location Line for View Title

Hello Everyone
I’m trying to write a script to move the tile view to Middle “Extension Line” or Middle Crop Region
It’s great for my Job
Thanks!

“Element.GetLocation” needs an Element as input, you feed in a parameter value,
try this:

1 Like

Thanks @Johannes_Meiners For help
I still can not getlocation
Do you know any other way?

Try rhythm’sViewport.LocationData. I think this might do what you want. image

1 Like

Hi @patrick_podeyn
I tried it that way but it did not give me the results I needed that’s move View Title middle line like topic

As far as I know we cannot set this item through the API. I could be wrong and hope I am. :worried:

Also, I updated your post title to better reflect what you need.

-john

2 Likes

@john_pierson I think you’re right; it looks like you can get the location of the View Title using this method but it doesn’t appear that you can set the location.

2 Likes

Yeah, that is the method I used in the node @patrick_podeyn referenced. Just now I tried modifying the outline with this method as well, but no luck there. :disappointed:

2 Likes

Hi @john_pierson @awilliams
I try script auto location View Plan, Sheet Name, Sheet Number and moving each view title it is take long time so I really hope to have a solution soon
Please see this is My Video! Thanks

@john_pierson It looks like its a separate method than your node is using (selected below), but that’s a moot point because there is no method to set the location anyhow. From searching it appears that this has been an API wish for some time though so maybe someday.

@Bach setting the location of the view title does not appear to be available via the API. You can get the location of it, shown in the image above with the Python script, but there isn’t a method to move or change its location :frowning:

2 Likes

@awilliams it’s good idea! I also trying to study python! Can you help me please use this document how dispatching command from API for cho python!
Thanks so much

@Bach this can’t be done even with Python, because there is no API method for it. Here is a potential (non-API/Dynamo) solution to edit the View Title family:

From your video above, it seems this would be a viable solution for your project. I would probably just have a separate View Title type used for smaller viewports like details

2 Likes

Thanks @awilliams !
I know what you mean! Maybe I will make another family view title for just View Plan

REVIT WORKAROUND: I had this problem recently. Edit your viewport family. Find the annotation family for the view title, and add a dimension to move it across by half your view width. I imagine this could be controlled with an instance parameter if you want it to vary.

2 Likes

Hi @Dharman
As mentioned above, we do not seem to have a solution to this problem

Dear @Dharman
I have done your way! But I do not know how to lock View Name with Reference line?

how would the code block shown (returning the bounding box of a view title) be modified to accept multiple view titles as input instead of just one?

@nelsonweeks you need to use a Python for loop; I can’t test right now but something like this should work:

vtitles = UnwrapElement(IN[0])
outlines = []

for vtitle in vtitles:
	minpt = vtitle.GetLabelOutline().MinimumPoint.ToPoint()
	maxpt = vtitle.GetLabelOutline().MaximumPoint.ToPoint()
	outlines.append(BoundingBox.ByCorners(minpt,maxpt)

OUT = outlines

or maybe this would work better:

vtitles = UnwrapElement(IN[0])
minpts = []
maxpts = []
outlines = []

for vtitle in vtitles:
	minpts.append(vtitle.GetLabelOutline().MinimumPoint.ToPoint())
	maxpts.append(vtitle.GetLabelOutline().MaximumPoint.ToPoint())

for min, max in zip(minpts,maxpts):
	outlines.append(BoundingBox.ByCorners(min,max)

OUT = outlines

hope this helps, sorry for any mistakes

2 Likes

@awilliams - thank you for the response. I finally was able to get something to work (see below), but it is great to see how you would have done it to better understand the code, and the proper way to go about it.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import*

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

vTitles = IN[0]
outline=[]

for vtitle in vTitles:

	rvTitle = UnwrapElement(vtitle).GetLabelOutline()
	minpt = rvTitle.MinimumPoint.ToPoint()
	maxpt = rvTitle.MaximumPoint.ToPoint()
	outline.append(BoundingBox.ByCorners(minpt,maxpt))


OUT=[]
OUT.append(outline)
2 Likes

I realize this is an older post, but I’m looking for a way to move view titles and this was the best hope I’ve seen yet. It doesn’t look like this does that, but I wanted to check if there was a way, using this approach. Or is this only getting the view title location? Thanks!