Assign equipment number to family showing space number

Hi all,
I am trying to assign equipment number to family showing space number and in case multiple families in same space they should have a running number.
That is Equipment number = BlockNo./ServiceName/SpaceNumber-01.
Problem is when I run py script to assign running number for those in same space the result in inconsistent (working for some and not for others).However if I sort the list and then apply py script result is fine. But then again I am struggling to assign values of this sorted list back to original element.(using set parameter value by name)

1 Like

@Dushyant_Negi Try using List.SortByKey

Connect your equipment list to the list input port
Connect the output of Block Number and service Space name to keys

In doing so the equipment list and sorted list should stay in sync.

Thanks a alot @Vikram_Subbaiah . Works like a charm,Also I am further planning to number the families inside the same space in a particular order (say clockwise) )which for now appear to be numbered as per the Unique IDs.

Any thoughts how that might be achieved ?
Thanks again .Cheers !!

Create a list of keys based on position and then sort.

Dear Dushyant_Negi

I would like to sign equipment code based on your way so Please you may send me it to use it if really dont mind
Thank you

Hi @mohmedsolla, this thread has been solved for over 2 years now. If you need help with a specific problem, can you create a new topic to keep things organized?

If you just need something from a certain person, you can send them a message by clicking on their name and clicking the Message button.

Yes :slight_smile: I have sent it just now , :slight_smile:
I hope can reply me soon

Thank you so much for your reply