BHoM / Revit_Toolkit

A set of tools enabling exchange of information between BHoM and Revit.
GNU Lesser General Public License v3.0
27 stars 13 forks source link

Revit_Toolkit: switch in DuctSectionProfile should not be based on ductShape variable #844

Closed pawelbaran closed 3 years ago

pawelbaran commented 3 years ago

Description:

As mentioned in the review of #833, the use of ductShape in the code below is redundant (and possibly dangerous): https://github.com/BHoM/Revit_Toolkit/blob/f7507830f1bdf7336702851bd0ee39d53fcb6c6b/Revit_Core_Engine/Query/DuctSectionProfile.cs#L58-L74

Instead, there could be a null check on profile the whole switch could probably be replaced with a single line:

return BH.Engine.MEP.Create.SectionProfile(profile as dynamic, liningThickness, insulationThickness);

Cleanup is needed.

pawelbaran commented 3 years ago

Fixed with #847.