Set Location Line for View Title

dynamo

#1

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!


#2

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


#3

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


#4

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


#5

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


#6

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


#7

@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.


#8

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:


#9

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


#10

@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:


#11

@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


#12

@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


#13

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


#14

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.


#15

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


#16

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


#17

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?


#18

@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


#19

@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)

#20

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!