How to get image of a family model without showing host element?

How to get image of a family model without showing host element?

Anonymous
Not applicable
1,745 Views
3 Replies
Message 1 of 4

How to get image of a family model without showing host element?

Anonymous
Not applicable

I have a lighting family file, and there is a ceiling host.   How can I get the image of the family (lighting) model?  

 

I can think of two methods:

(1)  Export image from family file, however, there is a host (grey rectangular solid box), how can I hide the host using API?

(2)  Load the lighting family file into a project model.  Then export the image. However, because it requires a ceiling host. How can I get the lighting fixture image without showing the ceiling background?  

 

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

jeremytammik
Autodesk
Autodesk

Dear Kukuzry,

 

Regarding 1)

 

Have you looked in the Revit API help file RevitAPI.chm?

 

Do you have that installed on your machine and a desktop shortcut set up for it?

 

If not, please do so right now, before reading on.

 

Searching it for 'hide' will quickly turn up the View.HideElements method.

 

That achieves exactly what you want.

 

Best regards,

 

Jeremy

 



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

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks 🙂

 

From this post: https://www.revitapp.com/blog/2010/11/hide-or-show-element-in-view/

I see that there are two methods.  If I use view.HideElements method, is there any easy way to access the host box element ID?  I can think of one method: filter all elements and then determine if its category (host as shown in the image) is subcategory of Lighting fixture in order to get the element ID used for view.HideElements method?

 

2015-03-03_021018.jpg

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Kukuzry,

 

The hiding has nothing whatsoever to do with how you can or cannot access the host box, whatever that may be.

 

The categories will help to filter for it, but you will first need to determine which of the possibly thousands of elements you want to filter among.

 

I have no idea what exactly a "host box" is.

 

In the case of doors and windows hosted by a wall, each door and window family instance element has a property specifying its host.

 

That would be the simplest solution.

 

Cheers,

 

Jeremy



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