BHoM / BHoM/Revit_Toolkit

Not all Revit => BHoM converts pass the type parameters to the output object

Open
#1,169 0 comments 0 reactions 2 assignees Assigned to @enarhi View on GitHub
type:bug
Dominant language
C#
Stars
35
Forks
16
Avg merge
7d 29m
Merged PRs (30d)
2

Description

#### Description:

On `FromRevit` convert, instance parameters are passed to the output BHoM object, while the type parameters should be attached to its defining property, e.g. `Construction` in case of `Wall` etc.:
Revit instance (`Wall`) <=> BHoM object (`Wall`)
Revit element type (`WallType`) <=> BHoM defining property (`Construction`)

The above is the ideal situation where the Revit element is converted to a BHoM object, and its type to a defining property, which means that they can be pulled and pushed back to update. This is not always the case, some of the returned BHoM types do not even have a defining property or it is not related to the Revit element type. The list below explains the issue for each type that does not work atm:
- [x] `BH.oM.Architecture.BuildersWork.Opening` - the object has a defining property, but it is not converted from the Revit element type, rather created based on the instance parameters
- [x] `BH.oM.Architecture.Elements.Room` - does not have a defining property
- [x] `BH.oM.Environment.Elements.Building` - does not have a defining property - but does not have a type in Revit either
- [x] `BH.oM.Environment.Elements.Opening` - does not have a single defining property (two Constructions), but `OpeningConstruction` is the only used in converts, so this one to be picked
- [x] `BH.oM.Environment.Elements.Space` - does not have a defining property
- [ ] `BH.oM.Facade.Elements.CurtainWall` - does not have a defining property
- [ ] `BH.oM.Facade.Elements.Opening` - does have a defining property, but the parameters are not copied to it when calling `GlazingConstruction` query, and are copied wrong (from host) when calling `ConstructionFromRevit`
- [x] `BH.oM.MEP.System.CableTray` - does have a defining property, but the parameters are not copied to it (do MEP elements have relevant element type in Revit?)
- [x] `BH.oM.MEP.System.Duct` - does have a defining property, but the parameters are not copied to it
- [x] `BH.oM.MEP.System.Fittings.Fitting` - does not have a defining property
- [x] `BH.oM.MEP.System.Pipe` - does have a defining property, but the parameters are not copied to it
- [x] `BH.oM.MEP.System.Wire` - does not have a defining property
- [x] `BH.oM.Physical.Elements.Door` - does have a defining property, but the parameters are not copied to it
- [x] `BH.oM.Physical.Elements.Window` - does have a defining property, but the parameters are not copied to it

There is at least a few idiosyncrasies that might be hard to fix because of the way the object models of Revit and BHoM are structured. I see the following possible solutions:
- in case of the types that do not have a defining property, attach a `RevitElementTypeFragment` to act as a element type representation
- in case of parameters not being copied to the defining property - try refactoring the code to make that happen (but remember it should be possible to update the type based on this defining property when pushed back!)

Happy to brainstorm around that and try to tackle in the next Milestone.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.