Select Element Component Sort by ID Instead of Selection Order?

Regarding the topic, when we select multiple objects in Revit, the component sorts all the objects by their IDs instead of the selection order. This makes it difficult to locate the corresponding Rhino objects within Revit. How can I maintain the selection order in this scenario?
image

Thank you.

If you need a specific selection order you’ll need to add something to sort by, or reference by specify id’s and use the Query Element Component.

In Revit you can select by id’s as well

Thank you for your reply,

The issue is as follows:

  • I want to add the parameter values assigned to the Rhino objects. (Let’s say there are 3 objects with different height)
  • I select the objects in Rhino: H1-H2-H3 using the “Brep” component, and this selection is preserved.
  • In Revit: I select the corresponding instances of the Rhino objects using the selection component. The selection will be sorted by ID. Result: The H are not assigned as I had planned.

I added a simple test:
Block_Change H.rfa (428 KB)
Change H.3dm (78.5 KB)
Change H.gh (11.3 KB)
Change H.rvt (6.9 MB)

I am aware of a few ways to solve this issue, but they are not straightforward. So, the question is: why is it necessary to sort the selection by ID? Is there any way to maintain the original selection order in Selection component?

Thank you.

Personally i would ensure sorting via Element ID or parameter (passing to the Rhino object for later use)

One way you can do this via selection is to Manage Graphical Element Collection and change the order (not ideal, just another way to rearrange)

Thank you, Japhy,

When we’re working in a single direction, from Revit to Rhino or vice versa, things seem to be functioning well. However, when we engage in a two-way exchange, Rhino ↔ Revit, some issues arise. Let me explain two scenarios to illustrate this:

Scenario 1:

  1. We create a 3D model in Rhino and then transfer it to Revit, complete with its associated parameters.

Scenario 2: 2) If we need to update the 3D model in Rhino, we retrieve the properties of the Rhino object and gather the parameter values for assignment to the corresponding object in Revit.

If we can maintain the selection order, the process becomes more streamlined. For example, if we select objects in Rhino in the order 1 - 2 - 3 …, we can replicate this order in Revit by selecting objects 1’ - 2’ - 3’ …, which correspond to the objects in Rhino. By doing this, we can ensure that the parameters update accurately and with much greater ease of control.

Currently, the process is a bit more complex. We need to cross-reference object IDs, identify the corresponding objects, and then select them in Rhino accordingly.

I hope it’s clear the issue.

This is where Elefront has been essential to Data Driven Workflows.

When baking into Rhino you can reconstitute in order with the Reference by BakeName (Maintain Paths). Or just filter by a UserText Value.

Taking this back and forth into Revit looks like this…

once applied (you can have this update on list length change) you can now reference your Revit from the Rhino object

If you need to go the other direction you’ll want to apply the Sort UserText to the Revit Element.

Rough example…

RiR-Sort-Data-Flow.gh (19.5 KB)

1 Like

Hi @lamvd,

We have added ‘Pick Elements’ component on v1.18 and will be in 1.17.
It keeps the order of the elements.

Used like this it allows you to pick only from the ‘Walls’ category, but you can plug in more complex filters.

May this work for you?

3 Likes

Thank @Japhy for taking the time to test and find the solution. Since Rhino objects are combined from surfaces, some data that is assigned to boxes/surfaces will be missing when exploded/trimmed and re-joined. Therefore, it cannot be guaranteed that the workflow will remain intact.

Thank @kike .This is what I’ve been looking for. Just a quick question: When we click the ‘Pick’ and ‘Select’ option in Revit, there is no ‘Finish’ function; we can only press ‘Escape’, and the objects are assigned to the component. Is that normal? Maybe this is a work in progress. I’ll wait for the next release, V1.17.

‘Pick Elements’ is implemented as a series of calls to PickObject method.
This method does not show the ‘Finish’ ‘Cancel’ UI.

Maybe we can provide an alternative UI but meanwhile this is the normal behavior, other Revit commands like ‘Wall’ do a similar thing and should be canceled by pressing ESC, so I don’t feel it that strange.

We have also added ‘Pick Points’ and work the same way. Until we have something better.

RiR-PlanarWallOpening.gh (21.5 KB)

Now are pure pickers, but at some point those ‘Pick’ like components will be automatically fired by the Player.

2 Likes

Thank you for explaining how it works.

Cheers,