You need to use EasyEDA editor to create some projects before publishing
Script to add wires for all pins
542 2
kargeor 3 years ago
I created this script to add wires for all pins in the schematic. I hope you like it: <br> ``` javascript function getRandomId() { return "gge" + Math.round(Math.random() * 10000000); } const ids = api('getSelectedIds'); const result = api('getSource', {type:'json'}); function addWire(x1, y1, x2, y2) { gId = getRandomId(); result.wire[gId] = { gId, pointArr: [{x:x1,y:y1}, {x:x2,y:y2}], locked: '0', strokeColor: '#008800', strokeWidth: '1', strokeStyle: '0', fillColor: 'none', }; } if (!(ids in result.schlib)) { alert("Please select object"); return; } const o = result.schlib[ids]; const allX = Object .keys(o.pin) .map(p => o.pin[p].configure.x); const minX = Math.min(...allX); const maxX = Math.max(...allX); Object.keys(o.pin).forEach(p => { const x = o.pin[p].configure.x; const y = o.pin[p].configure.y; let xx = x; if (x == minX) xx -= 50; else if (x == maxX) xx += 50; else return; addWire(x, y, xx, y); }); api('applySource', {source: result, createNew: false}); ``` [https://gist.github.com/kargeor/8a7444b68ed164409fb5935d375f5a77](https://gist.github.com/kargeor/8a7444b68ed164409fb5935d375f5a77)
Comments
andyfierman 3 years ago
@kargeor, It would be nice if you could post a couple of screenshots showing a simple schematic before and after running your script. Thanks.
Reply
deskpro256 3 years ago
Good job! But what does it accomplish exactly? A video or some screenshots as an example would be really nice. Otherwise just from the title it doesn't really make me want to use it :D Why would I want wires connected to all my pins? I might not use some pins and add a NC tag or some NET Port or just connect it to some component. Without any explanation this is just a solution to a problem I don't have! :D
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,建议访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice