coordinate which appear more than once from other list in autolisp

coordinate which appear more than once from other list in autolisp

Anonymous
Not applicable
633 Views
1 Reply
Message 1 of 2

coordinate which appear more than once from other list in autolisp

Anonymous
Not applicable

I have a coordinate list and in a every time in a loop of polyline  its will check the coordinate which appear more than once from the list in autolisp

0 Likes
634 Views
1 Reply
Reply (1)
Message 2 of 2

john.uhden
Mentor
Mentor

I presume that you want to "check" a coordinate only once, even if it is in a list more than once.

This may help to remove duplicates from a list:

  (defun @remdupes (Old fuzz / Item New)
    (while (setq Item (car Old))
      (setq Old (vl-remove-if '(lambda (x)(equal Item x fuzz))(cdr Old))
            New (cons Item New)
      )
    )
    (reverse New)
  )

It will work with numbers and coordinates.  OMG, it even works with strings.

John F. Uhden

0 Likes