(2022-03-24, 6:09)Jaco van der Molen Wrote: is someone willing to code this script?
I am. Quick-and-dirty without rounding or user-interaction. Just selecting all parts with the same Y value as the exactly one selected part.
Code:
function select_same_y()
local ses=ldc.session()
if not ses:isLinked() then
ldc.dialog.runMessage('No active model.')
return
end
local sel=ses:getSelection()
local cnt=sel:getRefCount()
if cnt~=1 then
ldc.dialog.runMessage('Exactly one item should be selected.')
return
end
local y=sel:getRef(1):getPos():getY()
local sf=ldc.subfile()
local refCnt=sf:getRefCount()
for i=1,refCnt do
local ref=sf:getRef(i)
local pos=ref:getPos()
if (pos:getY()==y) then
sel:add(ref)
end
end
end
function register()
local macro=ldc.macro('SelectSameY')
macro:setHint('Select all parts with same Y value.')
macro:setEvent('run', 'select_same_y')
end
register()