As far as we can see we can inherit from ReconstructElementComponent to create wall element in Revit. There is also a component called FamilyInstanceByLocation which allows us to create hosted object such as Window. However, we are trying to combine these two functionalities and create two objects in one component.
Is there any way we could re-use FamilyInstanceByLocation already build-in functionality (pin, preview etc.) combine with WallByCurve functionality?
public class WallByCurve : ReconstructElementComponent
void ReconstructWallByCurve([Some Input parameters])
[Create wall object]
[Create host object using ReconstructFamilyInstanceByLocation from FamilyInstanceByLocation class]
We are trying to keep the functionality of ReconstructElementComponent implemented in Rhino.Inside.Revit (for example functionality implemented in OnBeforeCommit, OnCommitted etc. events) which would work for couple elements at once. Not sure if currently implemented but looking at TrySolveInstance method of ReconstructElementComponent has only one ref Element which is passed forward. In our cases, we are trying to create couple elements (example. Wall with window, hole or/and door) and for all of those, we want to keep the functionality of events implemented in ReconstructElementComponent. Currently, As far as I understand, the implementation of TrySolveInstance allows to do it only for one element (one ref Element).
what would that look like in revit? are you trying to host a window onto a wall for example?
We would like to mimic the exact behaviour of Rhino.Inside.Revit components (for example how it highlights and previews elements, undo/redo in Revit UI etc.) on our own components.
is it sim to what you did with the floor and the opening here
It is. However, our current implementation lack functionality described above. In case of floor and opening, it seems to be a little bit unnecessary nevertheless there are a couple of extra components we are trying to implement:
We understand that we could override methods of ReconstructElementComponent and try to replicate what Rhino.Inside.Revit does. However, all additional code we would add this way seems to be unnecessary (and fragile on Rhino.Inside.Revit updates) since all this functionality is already there. Not sure how many additional changes it would cost you (or maybe everything is already there and we just unaware of it) but it would be great to be able to use it in the way I described earlier.