Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is element hidden? - in linked file

4 REPLIES 4
Reply
Message 1 of 5
Artur.Brzegowy
1555 Views, 4 Replies

Is element hidden? - in linked file

I have document A and document B linked into A.

In active view I make some elements in linked document (B) hidden.

 

How to get Information if given element is hidden?

 

Function element.isHidden(View) seems to work perfect for non-linked elements, but if I use in on elements from another document it always return false.

 

I also tried use:

coll = new FilteredElementCollector(linked_doc, main_doc.ActiveView.Id);

But still return hidden elements.

 

Thanks for any tip.

4 REPLIES 4
Message 2 of 5
saikat
in reply to: Artur.Brzegowy

Hi Arthur

 

All the active documents loaded in the current Revit session can be accessed using Application.Documents() collection and this includes the linked Revit documents as well. Once you have access to the document object of the linked model (B), it might be possible to extract the same view as in doc A in doc B and then find out which element is hidden in that specific view in B.

 

cheers



Saikat Bhattacharya
Senior Manager - Technology Consulting
Message 3 of 5
Artur.Brzegowy
in reply to: saikat

Thank you for quick answer.

 

I tried this but still elements in linked file which are hidden in host view - are visible.

 

This is how I search view in linked file:

 

FilteredElementCollector viewCollector = new FilteredElementCollector(curr_doc);
viewCollector.OfClass(typeof(View));
foreach (Element viewElement in viewCollector)
{
    if (((View)viewElement).Id == main_doc.ActiveView.Id)
    {
          curr_view = (View)viewElement;
          break;
    }
}

 

Then filer elements:

coll = new FilteredElementCollector(curr_doc, curr_view.Id);

 

And later in elements loop:

if(element.IsHidden(curr_view))
{
/*...*/
}

 

 

Questions:

1. View in document B are reference to view from document A or it is copy?

2. If I hide element in linked file in host view, then view in linked file is automaticly updated?

 

Thanks

 

Message 4 of 5

You could use the Revit 2014 custom exporter framework.

 

In fact, that is probably the only way to find out. Please have a look at

 

http://thebuildingcoder.typepad.com/blog/2013/07/graphics-pipeline-custom-exporter.html#6

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 5

Has anyone been able to make this work? Of course the intent is to be able to turn off elements in a linked model. Dale




______________
Yes, I'm Satoshi.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community