Components Reference Designators

  • Each electronic components on electronics PCB has a reference designator (unique location). The reference designator usually consists of one or two letters followed by a number, e.g. R13, C1002.

    I'm trying to create a UDF that gets a string of locations and returns a group of consecutive locations as shown:

    Examples:

    1. C1, C2, C3 ==> C1-C3

    2. R4, R1, R7, R5, R3 ==> R1, R3-R4, R7

    3. LD100, LD101, LD102, LD103, LD104, LD105, LD107 ==> LD100-LD105, LD107

  • The file cannot be attached due to legal issues, however here is the file content in table format:


    Component Location Location (Short Form)
    COMP1 R1, R2, R4, R4, R5, R6, R7, R8, R9, R10 R1-R10
    COMP2 C98, C99, C103, C104, C105, C109, C11, C111, C115, C116, C117, C121 C98-C99, C103-C105, C115-C117, C121-C125, C129-C130
    COMP3 U2, U6, U12, U13 U2, U6, U12-U13
    COMP4
  • Hello jonny,


    Quite an interesting question ...;)


    Do you currently have a draft UDF you could post ... or should this UDF be built from scratch ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Hello again,


    Drafted an initial UDF ...


    Hope this will help

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Sorry, Carim, just saw your code. Thank you.

    Don't know why , but somehow I'm not getting notifications once the answer is posted.


    Anyway the code is not grouping consecutive locations. By applying a code on U2, U6, U12, U13 I've gotten U12, U13, U2, U6.

    Where the expected result is U2, U6, U12-U13

  • Hello jonny,


    Thanks for your feedback ...


    Have not started working on the grouping ...


    My question was : Do you currently have a draft UDF you could post ... or should this UDF be completely built from scratch ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • OK ... Thanks ...


    It is a bit of a challenge ... since there are quite a number of different steps to cover ...


    Extract prefix, Split, Sort, Group, Insert dashes, Join ... and Clean


    So this will require some time and efforts ...8o

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Once you have had a chance to test the UDF ... feel free to share your comments ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Hi Jonny,


    Glad to hear this could help you out ...


    Thanks a lot for your very kind words ...:)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • MANY MANY THANKS ... for your Avalanche of THANKS ...:):):)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!