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)?
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.
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…
extract a list of lighting fixtures from the project
if list is more than 0, it will continue with the lighting fixture list.
if none, it will prompt a selection window for you to manually pick?
Select lights(max. 5) form the extracted list to get geometry and place bars in next step.
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.
There are several issues with the current logic apparently because…
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.
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.