On laye, have many slabs which have the same attribute pipe of DDName. I need a small macro to remove duplicates the slab if they have same attribute pipe of DDName instead of deleting manually one by one. Hope you can help me.
On laye, have many slabs which have the same attribute pipe of DDName. I need a small macro to remove duplicates the slab if they have same attribute pipe of DDName instead of deleting manually one by one. Hope you can help me.
You can use this macros standing on LAYE
!aSlabs = !!CollectAllFor('SLAB', '', ce) !aUniqueDdnames = ARRAY() do !slab values !aSlabs if(!aUniqueDdnames.FindFirst(!slab.Ddname).Unset().Not()) then $p [dublicat found] = $!slab $!slab delete slab handle none $p [dublicat deleted] elsehandle any $p [dublicat can not be deleted] endhandle else !aUniqueDdnames.Append(!slab.Ddname) endif enddo
Hi Emin I tried with your code but nothing happen
Sorry I misunderstood your task. Please test this macro
!aSlabs = !!CollectAllFor('SLAB', '', ce) !aUniqueDdnames = ARRAY() do !slab values !aSlabs if(!aUniqueDdnames.FindFirst(Pipe of $!slab.Ddname).Unset().Not()) then $p [dublicat found] = $!slab !pipe = Pipe of $!slab.Ddname $p [Pipe] = $!pipe $!slab delete slab handle none $p [dublicat deleted] elsehandle any $p [dublicat can not be deleted] endhandle else !aUniqueDdnames.Append(Pipe of $!slab.Ddname) endif enddo
It works so good, thank you Emin