How to select element by using SetElementIds method

Can anybody share your knowledge how to select element by using SetElementIds methods.

Hi @SHIBUJOSE,

See this post :

1 Like

but in and out are same values, correct?

You can replace the output (selected elements) by a message : “Success” if you want.

when I try the below code, I got a null out put. what may the reason

elements = UnwrapElement(IN[0])
select =

for i in elements:
select.append(i.Id)
Icollection = List [ElementId] (select)
o = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument.Selection.SetElementIds(Icollection)

OUT = o

I do not see where you define the output “s”.

sorry out is o not s
out put is null

This is normal behavior.
The output can only be the input or a message.

Actually what is Icollection. I search a definition for that term. But I couldn’t. can you help me

Springnodes already has an implementation of this.