• Anyone have a macro (or pml routine) for sorting drawlist members?

    Some of the drawlists I'm working with have been put together in a bit of a random way, I'd like to be able to sort the drawlist by the design item name.

    This will make it easier when checking drawlist for missing adde or reme
  •  

    -- *******
    -- function file for SORT hirarchye members
    --*******
    
    
    !CS = CURRENT SESSION
        !COLL = !!COLLECTMEMBERSOF(CE , '')
        !NAME = !COLL.EVALUATE(OBJECT BLOCK('!COLL[!EVALINDEX].NAME'))
        !NEWPOSITION = !NAME.SORTEDINDICES()
        !NAME.SORT()
        !COLL.REINDEX(!NEWPOSITION)
        !MCOUNT = !COLL.SIZE()
    
        DO !X values !COLL
            !Lock = False
            IF !X.USERCLAIM.EQ('') OR !X.USERCLAIM.EQ(!CS.USER().NAME) Then
                REORDER $!X AFTER $!MCOUNT
            ELSE
                $P$!X IS CLAIM BY $!X.USERCLAIM
            ENDIF
        ENDDO

  • Thanks.

    That's a normal sort, I wanted to sort by the ddnm of the adde (or reme), which aren't named, so the normal sort doesn't apply.

    Anyhoo, fixed it now.

    Ttfn
  • Acording


    For what purpose line '!NAME.SORT()'  is used? I understand that it sorted members(attribute Name) of array !NAME but for what?

    The sort part is:
    !NEWPOSITION = !NAME.SORTEDINDICES()
    !COLL.REINDEX(!NEWPOSITION
    )

    I guess it remained from the past..