- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
After creating / placing a viewport, how do I position the viewport title
Solved! Go to Solution.
Link copied
After creating / placing a viewport, how do I position the viewport title
Solved! Go to Solution.
Dear Jeff,
ViewPort title is defined by its ElementType.
No text at all:
You can find the BuiltInParameter.VIEWPORT_ATTR_LABEL_TAG there.
Its value type is of ElementId.
To remove title from your ViewPort, just assign an ElementType which has a invalid id in this parameter.
If there is no such one, create one by duplicating an existing type and setting the parameter.
Text but hidden:
Also, there is a BuiltInParameter.VIEWPORT_ATTR_SHOW_LABEL of type integer.
Just use a type which has a value of 0 (or create one).
I think the second method is what you want since you just want to hide it.
Nonetheless, in both cases you need to search for an fitting ElementType or need to create one.
Best regards,
Revitalizer
Dear Jeff,
I misunderstood you.
You want to move the title, not hide it.
As said in my comment, the is a BuiltInParameter.VIEWPORT_ATTR_LABEL_TAG parameter in ViewPort's ElementType.
As you can see (if there is set a valid ElementId), the referenced Element is of BuiltInCategory.OST_ViewportLabel.
You need to edit the relating family to fit your needings.
In this case, you need to identify the text elements inside the family document and move them.
Since other ViewPorts may refer to this family, you should think about creating a copy before modifying the original one.
Best regards,
Revitalizer
Hi hienngocloveyou,
ViewPort.GetLabelOutline is a Get but not a Set method.
Moving a Label means setting its Outline.
Which is not possible.
So if you have found another solution than editing the Family, let us know...
Revitalizer
Hi Jeff, all,
I had to do this (and had similar frustrations) when trying to automate sheet production via the API. I also found that, in 2014 at least, the viewport label doesn't tend to follow along when a parent viewport is moved after being instantiated. I tried several work arounds to get it to move with its parent viewport programmatically, but eventually gave up, and wrote a wrapper method that a.) hid the original viewport title, b.) instantiated a new text box heading family I *could* control, and c.) moved the two of them as a unit. The end result was easier to work with and gave me fine-grained control over the viewport's appearance. Not an ideal answer, I know, but a workaround if you find yourself in a pinch!
The problem is why autodesk make method GetLabelOutline, but don't have method for Set it, so method GetLabelOutline use what for ???
Thanks all for you comments. Honestly, except for the last post, I've not been notified that there have been any replies to my original post. I applogize for not commenting sooner.
I too have not heard about any method that will allow the relocation of the viewport title. I created a plugin that duplicates a sheet along with all of the viewports that can be duplicated. I've been able to get the duplicated sheet to exactly match the original - except for the viewport title. I'd really like to add this ability.
Someone from AutoDesk visited our firm a while ago and was to look into this. But, as is all to typlica of "marketing" guys - I've heard nothing.
In answer to the last post, I have only Revit 2014. I do not know if this has been resloved with 2015 and above.
Jeff
Arron,
I applogize for not responding sooner. I did not get notified of your reply.
Yes. Exactly.
I created a plugin that duplicates a sheet along with all of the viewports that can be duplicated. I've been able to get the duplicated sheet to exactly match the original - except for the viewport title. I'd really like to add this ability. It would make the plugin "complete."
Thanks,
Jeff
This would be very helpful to me. I create:
If there are 52 levels the draftsmen have to do a lot of work to arrange the titles so they may annotate the views easily (see picture 1). Automation would be preferable.
It does not seem the API exposes the location of the title (see picture 2).
It's been 3 years since your post, has there been any movement on this? I love how in Autodesk language "solved" means "you can't do it".
The Api not yet support this request. There is no way to solve that problem. We are waiting good new.
Hien.
Is there any update on this? Can we mass change the position / align all viewport tiltles ? There needs to be a way as it is tough to mange it in a project having more than 2000 sheets.
Look into Ideate Apps tool called Align. It will get the job done pretty nicely: https://ideatesoftware.com/ideateapps/align
As far as how they do it with the API, I haven't been able to figure out. It will even align cropped views. I think it does have trouble with split & squished views though which is understandable since it doesn't know where to line up.
Its not clever but as work around you can;
It would be good if the API had a method. Mine is a very "messy" workaround.
Hey Tony,
What you suggested can be generalized in the following manner for drafting views and legends:
1-Get the desired location of label and line in the view's coordinate system. For this, you should consider the view scale and margins when the view is placed on a sheet.
2-Empty the view, and only create a temp line at the presumed location of the label line.
3-Create the viewport; presumably, the label will be at the desired location* based on the default behavior of view placement in Revit.
4. Recreate the things that were removed in step 2, and get rid of that temporary line. The label will remain at its previous location.
* There is a catch: for certain viewport types, the api behavior can be different from when a user places a view on a sheet manually (surprise!). So even in this case, the outline will be closed to that of the desired label outline, but still a little different. To alleviate, you can go one step further between steps 3 and 4 above as follows:
3a-Obtain the label outline for the newly created viewport and by comparison to the desired outline, come up with a "correction" for temp line geometry (location and length), again, considering scales and margins.
3b-If the correction is significant:
3b-i- Remove the viewport, remove the temp line, create another temp line with the correction obtained in 3a.
3b-ii- Create another viewport - hopefully this time, the label will be at desired location, and you can proceed to step 4.
This sounds very messy as you suggested, but works as of Revit 2020.
Hope this helps.