How to create multiple Revit Elements within one GH component

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
[some code]
void ReconstructWallByCurve([Some Input parameters])
 [Create wall object]
[Create host object using ReconstructFamilyInstanceByLocation from FamilyInstanceByLocation class]
[some code]

Is this still an issue? See the latest RIR release that creates walls

yes, it is.

I am not sure what we look for, in the new release?
I just reviewed current code and we still can process as one element,
please guide me where to look for it… or advice on how to we could do it,

see here:

Ok could you clarify what you mean by “two objects in one component”?
what would that look like in revit? are you trying to host a window onto a wall for example?
is it sim to what you did with the floor and the opening here? How to create floor with opening ? issue with ReconstructElementComponent

thanks @msgambelluri so here are clarifications:

  1. “two objects in one component”?

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).

  1. 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.

  1. 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:

Here is our Opensource toolkit SAM, and in SAM_Revit we link via Rhino.Inside.Revit
SAMPanelRevit Component

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.

ps. would that be solved by adjusting here from element to List of elements? void TrySolveInstance