Collect the ID's of selected elements in the view

Hi,

I am wondering if it is somehow possible to collect the ID’s from the manuel selected elements in Revit. This in order to write a set of codes from Excel, to the parameters of the elements that are selected in the view.

It can be done with the ‘selected model elements’ node, or probably by creating a specific ‘selection view’. But as not everybody is familiar with dynamo and I do not want to force people to work with a specific view, I wondering if it can be done in another way.

Thanks in advance!

Kind regards,
Douwe

As far as I know the “select model element” node is the only node that lets you manually select whatever you want. The other selection nodes are by type or by family or by something.

I’m not sure I understand your question. You want to have the user manually select elements in the model then get the element IDs of those elements?

a non- dynamo user can get the element id of selected elements by using the IDs of Selection command in revit, which is available in the manage tab.

Not sure what you’d use that function for without Dynamo usage though. Selection of elements for non-dynamo users could be accomplished with a UI++ node and element selection node in the datashapes package, either with or without dynamo player usage.

Thank you all for you’re reactions.
@Nick_Boyts: Below the workflow I try to establish

  1. Dynamo is first manually started / script is openen
  2. Within Revit the elements are selected which should have te coding
  3. from the Excel list, the codes that should be pushed to Revit are defined.
    45
  4. Wihtin Excel button (run) is pushed (marco, true/false); this triggers the script to run
  5. The codes form the Excel are pushed to the parameter of the selected elements

So somehow feed the ‘select model elements’ with the ID’s of the selected elements in revit.

@jacob.small: would it be possible push these ID’s to dynamo, by e.g. python?

A workaround i’ve found on a forum states the elements (within Revit) can be selected and isolated (temp), which make it earier to use the selectionbox of the ‘select model elements’.

Below a picture of step 4 (new user are only allowed to upload 1 picture)

The workflow is a bit confusing.

Where are you getting the data that goes to the excel sheet?

What element types are receiving these parameters? Are they all of one category?

What types of parameter data are you working with for those elements?

What happens wth the macro (in excel) that causes dynamo (linked to Revit) to run?

How does the macro know what values to assign to which parameter?

I feel there is a faster method to accomplish what you are after, but don’t have enough of a picture to know what you’re after. Perhaps generating the first bit of excel data via Dynamo and then assigning parameter values in excel and writing those values back to the Revit model (no excel macro required)? Maybe using a lookup table directly in Dynamo to assign parameters based on a parameter value that already exists?

For selecting Revit elements via Dynamo use either the select Revit elements node or if you feel the users will be more novice and won’t be able to get all the right values try the UI select model elements in the datashapes package. Ideally you would simplify it even further to all elements of a given category, or all elements of a category in the active view.