const out={}; const grab = async (name, fn) => { try { const a = await fn(); out[name] = a.filter(o=>o.layerId===11 || o.layer===11).map(o=>({t:o.type, l:o.layerId!==undefined?o.layerId:o.layer, k:Object.keys(o).slice(0,14)})).slice(0,10); out[name+'_n']=a.length; } catch(e){ out[name]='ERR '+String(e).slice(0,60); } }; await grab('line', ()=>eda.pcb_PrimitiveLine.getAll()); await grab('arc', ()=>eda.pcb_PrimitiveArc.getAll()); await grab('poly', ()=>eda.pcb_PrimitivePolyline.getAll()); await grab('region', ()=>eda.pcb_PrimitiveRegion.getAll()); await grab('fill', ()=>eda.pcb_PrimitiveFill.getAll()); return out;