See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: Removing the double list pairs

  1. #1
    Active Member
    Join Date
    2006-05
    Location
    Pind
    Posts
    80
    Login to Give a bone
    1

    Default Removing the double list pairs

    Exactly this is how i need List 1 = ((0 0) (1 0.1) (2 0.1) (3 0.1) (4 0.2) (5 0.2) (6 0.3) (7 0.3))

    First of all the list given above can vary every time secondly i want to seprate the list for same cdr elements and store them to a variable Like i want like this and all the List with similar cdr element and make a list which contain all these values.
    thanks

    List A = (0 0)

    List B = (1 0.1) (2 0.1)(3 0.1)

    List C = ............................etc

    Thanks

  2. #2
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Removing the double list pairs

    How would you like your variables named? Also are you fine with having them as global variables (i.e. possibly overwriting something else)?

    If so, you could use some code like this:
    Code:
    (setq List1 '((0 0) (1 0.1) (2 0.1) (3 0.1) (4 0.2) (5 0.2) (6 0.3) (7 0.3))
          n 0)
    (foreach item List1
      (setq var (chr (+ (rem n 26) 65))
            m (/ n 26)
            n (1+ n))
      (while (> m 0)
        (setq var (strcat (chr (+ 65 (rem m 26))) var)
              m (/ m 26)))
      (set (read (strcat "List" var)) item))
    Just note, that I'd advise against doing this. Global variables should be kept to an absolute minimum as they can very easily cause other things to suddenly crash at unexpected times.

Similar Threads

  1. Double sheets in list
    By Bryan Thatcher in forum Revit Architecture - General
    Replies: 5
    Last Post: 2016-03-31, 11:40 PM
  2. removing items from list
    By mixted570595 in forum AutoLISP
    Replies: 5
    Last Post: 2012-05-06, 01:47 PM
  3. Linked Drawing List Schedule showing double sheets
    By troy.crandell635379 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2010-04-09, 08:16 AM
  4. Removing Double lines
    By rhayes.99001 in forum ACA General
    Replies: 2
    Last Post: 2006-06-20, 03:35 PM
  5. Removing duplicate strings in a list
    By whdjr in forum AutoLISP
    Replies: 7
    Last Post: 2004-06-09, 05:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •