Skip or Non selection in Selector

To consider when the quantity is 0, Is there any way to skip the selector?


Capture_select model elements2

@jaeho There must be a way with OOTB nodes or some package but I’m not aware of it.
If you are okay with using Python then try this out: Select Model Elements [Triggered by IF].dyn (5.0 KB)

2 Likes

Hi, Thank you for your solution. But I couldn’t get the expected result… I got a message box and selected lighting fixtures which I want to select but the Python script’s output was just 0,Do I need to change the code: PickElementsByRectangle() in the Python when the lighting flixture is not a flat plan(it has height)?

I believe the following logic may help.

  1. list.count the current amount of fixtures
  2. for conditional statement, you’ll need to input the true and false results… so…
    if test >0, input selected elements if true, input selected elements if false.

hope that helps.

1 Like

Delete everything in the Python node after line 15.

1 Like

here’s a screenshot of how an “if” works


Hi, Thank you for checking my codes.
I selected the fixtures in Revit while I was running the script, but still couldn’t get the elements.

Thank you for your solution.
I put these to consider when the lighting fixtures are not targeted and to select specific fixtures.


Even If I use the nodes like this, I still cannot skip the selection.

I think you need to use datashape.package.

hi jaeho,
sorry for the delay in responding.
i had a bit of thinking done and realize that it needs a bit of re-work in the logic. so let me get the intention straight for a start…

your intention is to…

  1. extract a list of lighting fixtures from the project
  2. if list is more than 0, it will continue with the lighting fixture list.
  3. if none, it will prompt a selection window for you to manually pick?

that’s my assumption. am i correct?

Hi, Thank you for your reply.

My intention is to

  1. Select lights(max. 5) form the extracted list to get geometry and place bars in next step.
  2. If there isn’t any fixtures on the ceiling then I want to skip the selection stage by just click empty space or any idea.
    I tried to put the python script but the nodes doesn’t recognize any fixtures.

Works just fine for me
Select Fixtures

There are several issues with the current logic apparently because…

  1. Usually with the category listing, you either get the elements or none. If none, it usually shows you an Empty List. So, you shouldn’t have to worry about skipping the selection.
  2. So, let’s say your list of elements are actually more than 5. What’s your selection criteria? By manual, random or do you need them in specific rooms only?

If your intention is purely just to do the following…

  • select the lights (method of selection can be manual or a programmed logic),
  • getting the geometry points and reference level,
  • place the bar family instance on the level at z value of 0

You shouldn’t need this conditional statement.
I would prefer to think of a conditional logic to detect any existing bar in that exact point instead.
if yes, do not place bar. if no, place bar.

What do you think? :slight_smile: