Inventor Engineer-to-Order

Inventor Engineer-to-Order

Reply
Valued Contributor
102 Posts
0 Kudos
Registered: ‎05-30-2006
Post 1 of 5

Remove duplicate list

113 Views, 4 Replies
01-29-2013 12:03 PM

I have 171 list and each list has 2 numbers. Some of the list are duplicates. Is there a function or loop that can do this.

Thanks, John

Employee
203 Posts
11 Kudos
Registered: ‎03-06-2006
Post 2 of 5

Re: Remove duplicate list

01-29-2013 12:07 PM in reply to: johnasp1

RemoveDuplicates.  Note, however, Scott Heide (see message below) found a defect in it when using a comparison function.  As long as you are satisfied with "Equal" as the comparison, it should work fine.  If it doesn't work in your particular case, please post a sample of the data, and I will look into it.

 

--Jack Gregory

Valued Contributor
102 Posts
0 Kudos
Registered: ‎05-30-2006
Post 3 of 5

Re: Remove duplicate list

01-29-2013 12:18 PM in reply to: JackGregory

  RemoveDuplicates() will remove duplicates within One list. I am trying to remove duplicate lists.

Example: {{4.5,6},{2.5,6},{1.5,8},{4.5,6}}

Collect all list except because it is a duplicate list.

John

Employee
203 Posts
11 Kudos
Registered: ‎03-06-2006
Post 4 of 5

Re: Remove duplicate list

01-29-2013 12:28 PM in reply to: johnasp1

Intent >RemoveDuplicates({1,2,2,3})
--> {1, 2, 3}
Intent >RemoveDuplicates({{1,2,2,3}, {1,2,2}, {1,2,2,3}})
--> {{1, 2, 2, 3}, {1, 2, 2}}
Intent >

 

Using your exact list:

Intent >RemoveDuplicates({{4.5,6},{2.5,6},{1.5,8},{4.5,6}})
--> {{4.5, 6}, {2.5, 6}, {1.5, 8}}

 

It is recursive.

 

--Jack Gregory

 

Valued Contributor
102 Posts
0 Kudos
Registered: ‎05-30-2006
Post 5 of 5

Re: Remove duplicate list

01-29-2013 12:36 PM in reply to: JackGregory

wow...it works.

Thanks, John

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.