Made a quick and dirty one:
Save it to a .lua file and place it in LDCad/scripts/default/global to use it.
It will find identical parts at (nearly,<0.1 ldu) the same place ignoring color and rotation.
Code:
function isUique(lst, needle)
for key, item in pairs(lst) do
if needle.name==item.name and (needle.pos-item.pos):getLength()<0.1 then
return false
end
end
return true
end
function onRun()
local sf=ldc.subfile()
local sel=ldc.selection()
local lst={}
sel:remove()
for i=1,sf:getRefCount() do
local ref=sf:getRef(i)
local info={pos=ref:getPos(), name=ref:getName()}
if isUique(lst, info) then
table.insert(lst,info)
else
sel:add(ref)
end
end
end
function register()
local macro=ldc.macro('Select dups')
macro:setEvent('run', 'onRun')
end
register()
Save it to a .lua file and place it in LDCad/scripts/default/global to use it.
It will find identical parts at (nearly,<0.1 ldu) the same place ignoring color and rotation.