const cs = (await eda.sch_PrimitiveComponent.getAll()).filter(c => c.getState_ComponentType() === 'part'); const out = cs.map(c => [c.getState_Designator(), Math.round(c.getState_X()), Math.round(c.getState_Y()), (c.getState_Component()||{}).name]); const cnt = {}; for (const o of out) cnt[o[0]] = (cnt[o[0]] || 0) + 1; const dup = Object.keys(cnt).filter(k => cnt[k] > 1); const d1 = cs.find(c => c.getState_Designator() === 'D1'); const d1p = d1 ? (await d1.getAllPins()).map(p => [p.getState_PinNumber(), (p.getState_PinName ? p.getState_PinName() : ''), Math.round(p.getState_X()), Math.round(p.getState_Y())]) : null; return { n: out.length, dup, dupRows: out.filter(o => dup.indexOf(o[0]) >= 0), d1p };