You need to use EasyEDA editor to create some projects before publishing
Is there any way to align Net Labels ?
1308 6
MikeDB 3 years ago
It might seem a bit OCD, but I have to give these schematics to my clients and the lack of either left or right alignment to the Net Labels doesn't make them look good.  I've tried moving them around but this is the best alignment I can get as they move in staggers, almost like every label has a different snap position.  Any suggestions how to fix this ? ![image.png](//image.easyeda.com/pullimage/FRRRJMy9eoAamMnfwBgDvVD390vkrOBOKSWTaoHc.png)
Comments
andreasbernhofer 3 years ago
Hey, you MAY try this script. Just select all ports you want to re-align (e.g. right-click one and find similar), then go to Advanced -> Extensions -> Run Script ``` js // Reset NetPort Mark alignment (select Ports first) s = api('getSource','json'); api('getSelectedIds').split(',').forEach((k)=>{ if(s.netflag[k] && s.netflag[k].mark) { s.netflag[k].mark.x = Number(s.netflag[k].configure.x) + (23 * (s.netflag[k].configure.rotation == 0 ? -1:1)); s.netflag[k].mark.y = Number(s.netflag[k].configure.y) + 3.5; s.netflag[k].mark.textAnchor = (s.netflag[k].configure.rotation == 0) ? 'end' : 'start'; } }); api('applySource',{source: s, createNew: false}); api('editorCall','fitview'); ``` It will only work for horizontal labels. Please make sure you have a backup :)
Reply
andreasbernhofer 3 years ago
And a different version that does the same but won't reset the view (applying new project source always resets the view): ``` js // Reset NetPort Mark alignment (select Ports first) s = api('getSource','json'); api('getSelectedIds').split(',').forEach((k)=>{ netflag = s.netflag[k]; if(netflag && netflag.mark) { netflag.mark.x = Number(netflag.configure.x) + (23 * (netflag.configure.rotation == 0 ? -1:1)); netflag.mark.y = Number(netflag.configure.y) + 3.5; netflag.mark.textAnchor = (netflag.configure.rotation == 0) ? 'end' : 'start'; netflag.gId = netflag.configure.gId; api('updateShape',{ shapeType:'netflag', "jsonCache": netflag }); } }); ``` Btw. if you want to change the space between the port and its label, that's the `23` in the code. `3.5` is the vertical offset which was right at the middle for me, but it may have to be changes with different font sizes.
Reply
deskpro256 3 years ago
Hi, I usually do it manually while I'm placing the flag and changing names. I know that if I don't do it then, I won't do it or it will be painful later. I have the snap to 5 and Alt snap to 1. Then, if needed, I can get the flag or its name to snap to a grid and look aesthetically pleasing. Haven't tried what Andy has there, but that seems like a good alternative to manual work if the schematic has many connections like that. Hope that also helps you or anyone else reading this. Cheers!
Reply
deskpro256 3 years ago
@deskpro256 Sorry Andreas, called you Andy by habbit!
Reply
MikeDB 3 years ago
@deskpro256 Sorry but where is Snap in the Schematic editor ?   I was looking for that and couldn't find it hence the question
Reply
andreasbernhofer 3 years ago
@deskpro256 It's okay, I don't care ;) @MikeDB make sure the right hand panel is open and click on a blank spot ![2021-01-07 19_30_26-.png](//image.easyeda.com/pullimage/12GfMrsGDQ81dXzaefiy4WkGnnn9i0kkvr6kTs2u.png) But for that amount of labels, aligning them manual is insane...
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