Get Elements in Active Selection

Yeah too much going on in this one, here’s a simplified version. While experimenting I got another error message


Active Selection bug.gh (44.5 KB)

This stripped down script still brings the same error message


I am going to try with just the active selection button on.

Okay, I found the problem, the active selection doesn’t seem to play well with Add Geometry Direct Shape
Revit fill surface with equally spaced points.gh (53.8 KB)
I have disabled the connection between this component and the rest of the script and it seems to be smooth now. @Japhy could you see if there was a way to make Add Geometry Direct shape run smoothly with Active Selection ?
Thank you

Direct Shapes aren’t ‘Real’ Revit objects, in some ways they act more like imported geometry. In this case i’m not sure that is the issue. The Revit Face Reference only gives the one.

There is a feature request for additional control on the face reference selection. Add Ability to Get Multiple Face References without the Revit UI · Issue #785 · mcneel/rhino.inside-revit · GitHub

I am not debating what Direct Shape creates, I am just stating the fact that in this example when I disabled Direct Shape the bug went away, my guess is that Since Active selection runs constantly in Revit, it doesn’t allow other commands to be launched, which is what Direct Shape is trying to do, therefore bug.

I’m not seeing anything out of the ordinary here. Can you provide a clean example of the issue? What do you mean by doesn’t play well?

direct shape add selection

Good morning, I tried with the most simple script possible, here’s what I got


Test bug active selection.gh (65.4 KB)
I think the problem comes from the connection of Active selection to Direct Shape, that continuity is the problem, not their presence merely on the canvas but their connection in a line. Take a look

What am i looking for here?

Try to use player instead of the regular grasshopper command prompt, it doesn’t work for me.
Then try to open the same script in the same work session with the regular grasshopper command, the bug should appear.

Took me a bit but i was able to repeat. Thanks

No problem, probably the Revit API not being able to process too many things at the same time. Thank you @Japhy, you’re one hell of an engineer

Can you repeat with this simplified version? Thanks
active-selection.gh (7.9 KB)

Still can’t be used with Player, and after trying to open it with player, can’t be opened with the regular Grasshopper window, same error

@thomas.lagarde, have you installed the latest version?

Hi Thomas. I‘m also having the same issues for complex scripts with the grasshopper player. With an active grasshopper window the script is working. When running it with the player it crashes.
I found a solution to fix this:
I‘m placing a „launch window“ component of the human UI add-in for grasshopper. This ensures that the script finishes. I‘m placing a „null item“ component to test if the Revit elements are created. This way I‘m using the null flag to close the human UI window when the script finishes.
I hope it’s clear enough…

1 Like

I’ll try it, I hope this will be fixed soon. Thank you.

Can you show us with a screenshot your logic ?

Hi Thomas,
I’m sorry, I don’t have access to my work computer at the moment.
Just try to place the human ui component launch window with the Boolean set to true for the input show. And test if the script runs through if your using the player.

I am not giving up on this, I will try again soon

This is now available since RiR v1.22 and Revit 2023.

1 Like