How to get Door and Window parameter in the Wall

How to get Door and Window parameter in the Wall

Anonymous
Not applicable
1,980 Views
4 Replies
Message 1 of 5

How to get Door and Window parameter in the Wall

Anonymous
Not applicable

Dear all,

 

Please help me.

How can I get the parameter of the Door and Window in the wall?

Because I want to create Steels boundary around these items and follow their Width and Height.

 

Thanks

0 Likes
1,981 Views
4 Replies
Replies (4)
Message 2 of 5

Omar_Amen
Advocate
Advocate

Hi @Anonymous !
the Wall class inherits from HostObject class so you can retrieve all the hosted elements on your wall (including doors and windows instances)
in the code if you have (Wall w;)
you can do:

w.FindInserts(true,true,true,true);
Message 3 of 5

jeremy_tammik
Alumni
Alumni

It is unclear to me what you mean by "get the parameter of the Door and Window in the wall".

 

It is definitely possible to access the doors and windows hosted by the wall. 

 

One way is to retrieve all doors and windows is to use a filtered element collector on the wall's bounding box, retrieve the door and window elements and check their Host property to match the target wall.

 

That approach was described here back in 2008:

 

https://thebuildingcoder.typepad.com/blog/2008/10/relationship-in.html

 

Nowadays, though, the wall has a property FindInserts to retrieve the elements it hosts:

 

https://thebuildingcoder.typepad.com/blog/2015/03/findinserts-retrieves-all-openings-in-all-wall-typ...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 5

QuangNguyen-ICE
Enthusiast
Enthusiast

Thanks, @Omar_Amen 

0 Likes
Message 5 of 5

QuangNguyen-ICE
Enthusiast
Enthusiast

Thanks, @jeremy_tammik 

0 Likes