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: 

Finding Exterior walls by BuildingEnvelopeAnalyzer

15 REPLIES 15
Reply
Message 1 of 16
jinsol.kim
2735 Views, 15 Replies

Finding Exterior walls by BuildingEnvelopeAnalyzer

Hi,

 

I would like to find all exterior walls that are exposed to the outside of the building using BuildingEvelopeAnalyzer class.

I have tested with different values of GridCellSize in BuildingEnvelopeAnalyzerOptions to find outmost elements, but depending on the grid cell size the number of bounding elements were increased or decreased. When I set OptimizeGridCellSize to true, it always return interior walls as bounding elements. Can you tell me the bets way to define the grid cell size to collect building envelope elements only?

Thanks,

 

Jinsol

15 REPLIES 15
Message 2 of 16
jeremytammik
in reply to: jinsol.kim

Dear Jinsol,

 

Thank you for your interesting question.

 

I have actually never seen the BuildingEnvelopeAnalyzer in action, so it would be interesting to see a snippet of sample code for it:

 

http://thebuildingcoder.typepad.com/blog/2014/04/whats-new-in-the-revit-2015-api.html#3.12

 

Have you also looked at the SpatialElementGeometryCalculator to achieve this?

 

http://thebuildingcoder.typepad.com/blog/2015/04/gross-and-net-wall-area-calculation-enhancement-and...

 

Cheers, 

 

Jeremy



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

Message 3 of 16
sanjaymann
in reply to: jinsol.kim

Hi

 

Exterior of the wall can also be found as follows:

 

Wall pickedWall = ele as Wall;

 

// Get the side faces

IList<Reference> sideFaces =

    HostObjectUtils.GetSideFaces(pickedWall,

      ShellLayerType.Exterior);

// access the side face

Face face =

    uiDoc.Document.GetElement(sideFaces[0])

    .GetGeometryObjectFromReference(sideFaces[0]) as Face;

 

 

Thanks & Regards

Sanjay Pandey

Message 4 of 16
jinsol.kim
in reply to: jeremytammik

Hi Jeremy, 

 

After I've tested with multiple values for Grid Cell Size, the length from a floor to the upper floor seems to be appropriate to capture bounding elements exposed to outside only. Otherwise the smaller the grid size is, the more bounding elements are captured even with interior walls.

I may need to test a little bit more with the grid cell size to understand how this grid size exactly affects to the BuildingEnvelopeAnalzer class.

Thank you for your answer.

 

Jinsol

 

 

List<Wall> exteriorWalls = new List<Wall>();
BuildingEnvelopeAnalyzerOptions options = new BuildingEnvelopeAnalyzerOptions();
options.AnalyzeEnclosedSpaceVolumes = false;
options.GridCellSize = floorHeight; //founded by ReferenceIntersector from a point on a floor to search for the upper floor.
options.OptimizeGridCellSize = false;
BuildingEnvelopeAnalyzer analyzer = BuildingEnvelopeAnalyzer.Create(m_doc, options);
if (null != analyzer)
{
IList<LinkElementId> linkIds = analyzer.GetBoundingElements();

if (linkIds.Count > 0)
{
foreach (LinkElementId linkId in linkIds)
{
if (linkId.HostElementId != ElementId.InvalidElementId)
{
Wall hostWall = m_doc.GetElement(linkId.HostElementId) as Wall;
if (null != hostWall)
{
exteriorWalls.Add(hostWall);
}
}
else if (linkId.LinkedElementId != ElementId.InvalidElementId)
{
RevitLinkInstance rvtInstance = m_doc.GetElement(linkId.LinkInstanceId) as RevitLinkInstance;
if (null != rvtInstance)
{
Wall linkWall = rvtInstance.Document.GetElement(linkId.LinkedElementId) as Wall;
if (null != linkWall)
{
exteriorWalls.Add(linkWall);
}
}
}
}
}
}

Message 5 of 16
jeremytammik
in reply to: jinsol.kim

Dear Jinsol,

 

Thank you for your sample code.

 

Looking forward to hear what else you find out.

 

Source code is more readable if you use the 'Insert Code' button at the top with the icon '< >'.

 

Cheers, 

 

Jeremy



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

Message 6 of 16
jinsol.kim
in reply to: jinsol.kim

Okay. I'll post some updates if I find anything regarding this issue.
Thanks,

Jinsol Kim
Software Developer

HOK
5 Bryant Park
1065 Avenue of the Americas, 2nd Floor | New York, NY 10018-0829 USA
t +1 646 385 7693 jinsol.kim@hok.com

hok.com| connect

Learn more about HOK's new Sports + Recreation + Entertainmentpractice.
Message 7 of 16

Hi Jinsol,

 

I would like to use BuildingEnvelopeAnalyzer Class to find exterior walls.

 

Do you have any update on this issue ?

 

Thanks,

Message 8 of 16
jeremytammik
in reply to: jinsol.kim

Dear Jinsol and Alexandra,

 

I raised this issue with the development team, and they say:

 

BuildingEnvelopeAnalyzer is supposed to be a reliable method to achieve this.

 

If there are problems with the results, this should be filed as a problem report.

 

For us to do so, please submit a minimal reproducible case:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

To perform your own geometric analysis, you could also look for walls which don't have bounding rooms on both sides. That is easy, assuming rooms have been set in the model.

 

Cheers,

 

Jeremy

 

 



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

Message 9 of 16
jeremytammik
in reply to: jinsol.kim

After further discussion with the development team, they asked: Is the building model enclosed? It needs to be in order for the analyzer to work. In other words, do you have Roof and Floor elements to form enclosed spaces in the model?

 



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

Message 10 of 16

Hi,

 

Thank you for you answer.

 

I launch my Python's script with BuildingEnvelopeAnalyzer Class.

 

With a "sample" Building, it works, but when I got curved walls it's not working.

Message 11 of 16

Dear Alexandra,

 

Thank you for your update and glad to hear that it works for you in certain cases.

 

However, apparently, you have no read my previous answer above that I shared on May 16:

 

Is the building model fully enclosed? It needs to be fully enclosed in order for the analyser to work. In other words, you need to have Roof and Floor elements above and below the walls to form enclosed spaces in the model. If that is not the case, then all walls can be considered exterior, because they touch the outside space around the building envelope along their bottom and top faces.

 

Looking at the image you attached, I do not see any floors, roofs, or enclosed spaces.

 

In that case, the building analyser cannot be used.

 

Just last week, we implemented a workaround by placing a large temporary room around and outside the building to solve the task in such a situation:

 

http://thebuildingcoder.typepad.com/blog/2018/05/filterrule-use-and-retrieving-exterior-walls.html

 

I hope this helps.

 

Cheers,

 

Jeremy

 



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

Message 12 of 16

Dear Jeremy,

 

I have filter the roof and floor after the utilisation of BuildingEnvelopAnalyzer class.

 

That's why, we can see only the walls on my screenshot.

 

 

Message 13 of 16

Dear Alexandra,

 

Thank you for your update and clarification.

 

In that case, you seem to have identified a problem.

 

Please provide a minimal reproducible case that I can share with the development team for further analysis:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you!

 

Cheers,

 

Jeremy

 



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

Message 14 of 16

Dear Alexandra,

 

Thank you for your report and the reproducible case that you sent by private email.

 

Sorry to hear that the BuildingEnvelopeAnalyzer does not return the expected result.

 

I logged the issue REVIT-131862 [BuildingEnvelopeAnalyzer returns wrong walls -- 14230846] with our development team recently for a related problem described by Feng Wang in the thread on getting all the outermost walls in the model:

 

https://forums.autodesk.com/t5/revit-api-forum/how-do-i-get-all-the-outermost-walls-in-the-model/m-p...

 

In the meantime, the development team reacted to that issue and registered a new development issue for a future release, REVIT-132477 [SUPPORT ISSUE - BuildingEnvelopeAnalyzer returns wrong walls -- 14230846].

 

I updated with the material you provided and renamed it to REVIT-132477 [SUPPORT ISSUE - BuildingEnvelopeAnalyzer returns wrong walls -- 14230846, 10783979].

 

Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

Best regards,

 

Jeremy

 



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

Message 15 of 16
jeremytammik
in reply to: jinsol.kim

Dear Alexandra,

 

Thank you for your patience. The engineering team repsonded to the development ticket REVIT-132477 [BuildingEnvelopeAnalyzer returns wrong walls -- 14230846, 10783979] and say:

 

I am not sure whether BuildingEnvelopAnalyzer is meant to find the outside walls. I tweaked the attached API sample to have smaller GridCellSize (say 1 ft). That resolves the issue of some walls not being found. However, all walls including interior walls are returned.

 

I also looked at the code implementation. So far I haven't found any indication that the algorithm should differentiate between interior or exterior walls. While it may be theoretically possible to enhance the algorithm, no such project has yet been discussed.

 

Best regards,

 

Jeremy

 



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

Message 16 of 16
jeremytammik
in reply to: jinsol.kim

The development team worked on the ticket #REVIT-132477 [BuildingEnvelopeAnalyzer returns wrong walls -- 14230846, 10783979] and say:

 

With the fix of adding Ceilings to the process, if you lower the inner wall down to 8 ft of height, and stretch out the ceiling to cover the space, you should get the 4 outer walls as the envelope when you run the macro.

 

to_ceiling_1.png

 

to_ceiling_2.png

 



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

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