Is there a way to extract the visibility graphics settings of a category? So you could have access to the default line weight, patterns, colors. ex… I have been looking and have not found anything witch makes me think its an API / scripting solution.
You’re right it’s something that you need the API for. Luckily it’s quite a trivial matter:
Thank you very much for the code. That is rather simple.
Do you know why the -1 is showing up for everything other than the color. The CutLineWeight should be 5.
Edit: I did just see that Line 4 should have IN. I fixed this but still the same result.
Through investigation the -1 means it is set to default. Is there a way to get the default or would this need to be done from Object Styles rather than VG?
Also the fill pasterns return the ID number. Can this be changed into the name of the fill pattern?
Hi Everyone, I am interested in leveraging Dynamo to automate targeting specific areas of the VG settings. We have a series of linked models all together and have determined to have sheets live in 1 central model location with linked views. Because of this, we have to removed ‘Revit Links’ from our View Template in order to establish the linked view. What I’m shooting for is consistency in the view template which leads me (in some cases) to select custom linking options to have things like Filters listen to the host view rather than linked view. Rather than 1 by 1 changing these many interior elevations to focus on host view filter settings rather than linked view, an automated Dynamo script to flip this switch would be amazing. I apologize if this seems convoluted and confusing. We debated as a team best methods to keep our model as lightweight as possible and this is what we came to. Let me know if this type of surgical targeting is possible with Dynamo. Thanks!! Tim
Can what you are asking just be done with view template?
I totally get where you are coming from, Tim. At my firm we would also like to be able to control the visibility graphics of linked files. In your screenshot we would be interested in ‘by linked view’ and then to set the ‘linked view’ through Dynamo. Obviously, this setting will be different for every floor plan (for my first floor view I would like to select the linked files’ first floor view as well in order to see dimensions and such from this linked revit file, for my second floor … etc.) and that’s why we cannot include Revit Link in our floor plan template.
Not trying to hijack your thread, Tim, just stating my common interest in this matter!
Based on what Tim said and that they are referencing there own views the ‘by linked view’ should work. It would just take the settings from their other file.
Rene if you are using consultants linked models then this would not work as they maybe showing things you do not want to see. I am not however seeing the point of using Dynamo. You are saying every view will have different setting thus you can not use a view temple. If you were to use Dynamo to do this you would still need to change all of the settings in script for each view (the same amount of work). You may not need to scroll through all of the setting but it could require to you re-right some of the script depending on what you want in that view.
While I have not found a solution to my problem yet I think this post has died so it is fine that you hijacked it.
The API does not allow any access to the Revit Link V/G overrides and thus it’s impossible to change them directly through Dynamo.
Yes, -1 is the default null value for element containers ( or an InvalidElementId object). You can get the default value (or graphics style) but you can’t do anything meaningful with it because the API does not expose any of its properties. That’s supposedly coming in Revit 2017.
You can convert any elementId to an element and extract names and any other properties from that:
This there a way to just toggle the “Show model categories in this view” within the Visibility/Graphic Override to instead of having to try and find all of the categories in the view to then turn it off?
As it is stated in this link below but I can’t find how to do it.
This affects only if the category is set visible or invisible individually. Other Revit mechanisms may also affect the visibility of elements of this category, including:
- the category classes settings for model categories, annotation categories, import categories or analytical model categories.
Or have I read that wrong?
One option that comes to mind is to create a new view template that has only the model categories hidden by default and then proceed to apply that template to the necessary views.
I have look in doing that but I really want the dynamo script that I want to be completely dependent.
I can’t believe the API is completely missing this I would of thought it would of be something that they would of added.
Maybe the only way is to make a list of all of the categories that need to be turned off, but I was hoping that there was a better way to do that.
Every time you start a new project with a new link. You have to set up the view templates for the link. Would be great if they allow access to the API to select a link and put on pre set view settings to it