Controlling Visibility of Linked File Elements with the API

Controlling Visibility of Linked File Elements with the API

sragan
Collaborator Collaborator
1,495 Views
3 Replies
Message 1 of 4

Controlling Visibility of Linked File Elements with the API

sragan
Collaborator
Collaborator

Is it still true that there is no API method for controlling the visibility of elements that are part of a linked file?

 

I hope not.  It would be very handy to be able to control the view specific visibility of linked elements.  For example, I frequently need to hide specific linked elements, or entire linked categories in a view.  Or sometimes I need to halftone these elements, or change their line weights.     The way this is done through the User Interface is very clumsy, and it takes a lot of clicks to perform a simple task.

 

It would be great if the API provided a means to access the visibility of these elements.  However, from this thread, I get the impression that Revit hasn't included this functionality in the API yet:

 

Hiding linked files elements - Revit - Dynamo (dynamobim.com)

 

I would like to be able to write a simple routine that controls the visibility of linked Revit Elements similar to the way the User Interface lets you control the visibility of layers in a linked AutoCad drawing.   For example, you run the routine, select an element, and then have a button that hides the element category in the current view.   That would be very handy.

 

 

 

 

0 Likes
Accepted solutions (1)
1,496 Views
3 Replies
Replies (3)
Message 2 of 4

sragan
Collaborator
Collaborator
Accepted solution

Opps, I just found this;

 

RVT Link Display Settings - Autodesk Community - Revit Products

 

Apparently the answer is a simple No.

 

0 Likes
Message 3 of 4

sragan
Collaborator
Collaborator

My first gut reaction was that there can't be a workaround for this, like there are for so many other API limitations.  No access to the visibility parameters means no possibility of a workaround.

 

But what about View templates?  Maybe it be possible to create or edit a template to control the linked elements, and then apply the template to the view, and then turn the template back off?   I've tried using a similar workflow with the user interface, and it seems to work, but it's not efficient enough.

 

This thread makes me think it might be possible:

 

How to access View Template Properties for Revit and compare them in Real Time? - Stack Overflow

 

0 Likes
Message 4 of 4

GaryOrrMBI
Collaborator
Collaborator
Assigning View template properties (or assigning a template, to set the values, then removing the assignment) can be done via the API.

Setting up the View template can't be done via the API because it is essentially just another view and, as you pointed out, that can't be done via the API at this time, regardless of how often we may have asked for it.

But these two facts do allow for a hybrid approach as a workaround (assuming that you are working on a given project to set the view template up via the UI in the first place).

-G
Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes