You need to use EasyEDA editor to create some projects before publishing
Api select command does not update the attribute panel
491 11
Wolf Van Herreweghe 4 years ago
I wrote a simple script to select various components on my schematic. The command for selection works, but does not update the attribute panel. ![image.png](//image.easyeda.com/pullimage/NlxkCugvSd7LGAlGC2EuKv6Xbtuv5Ka4WjkoxdFJ.png)
Comments
andyfierman 4 years ago
It is not clear what your post is about. Are you telling us that you have written a script? Are you asking for help in fixing the update attribute bug? Please clarify and post a link to your script.
Reply
Wolf Van Herreweghe 4 years ago
Here is the script I've going. ``` var result = api('getSource', {type:'json'}), id; console.log(result); var ids = []; for (id in result.schlib) {     if(result.schlib.hasOwnProperty(id)){         var object = result.schlib[id].annotation;         var subObject = Object.keys(object)[0];         var objectString = object[subObject].string;         if(objectString  == "MX-ALPS-1U" )         {             ids.push(id);         }     } } console.log(ids); api('select', {ids:ids}); ``` The script works, it selects all the symbols with the MX-ALPS-1U name. But the right attribute panel does not update. EasyEda did not see that the selection has been updated.
Reply
andyfierman 4 years ago
So are you asking for help on how to make it update the Selected Object field?
Reply
Wolf Van Herreweghe 4 years ago
Sure, You'd think that the 'selected object field' would update automatically when using the select command
Reply
JLCPCBsupport 4 years ago
@wolfvanh Hello ; Probably you need to insert the Selection API in your second if statement, means as follow : ``` var result = api('getSource', {type:'json'}), id; console.log(result); var ids = []; for (id in result.schlib) {     if(result.schlib.hasOwnProperty(id)){         var object = result.schlib[id].annotation;         var subObject = Object.keys(object)[0];         var objectString = object[subObject].string;         if(objectString  == "MX-ALPS-1U" )         {             api('select', {ids:[id]});             ids.push(id);         }     } } console.log(ids); ```
Reply
Wolf Van Herreweghe 4 years ago
@JLCPCBsupport The goal of the script was to select all symbols with the name MX-ALPS-1U. The code I've provided does work. However the attribute panel does not update ( property panel ) with the new selection. EasyEda still thinks there are no objects selected.
Reply
andyfierman 4 years ago
@wolfvanh, Have you tried the modification suggested by JLCPCBsupport?
Reply
JLCPCBsupport 4 years ago
@wolfvanh Regarding the API guideline, to select objects you need to use the following instruction : ``` api('select') ``` I didn't saw it in your program that's why I advised you to try :)
Reply
Wolf Van Herreweghe 4 years ago
@andyfierman Yes I tried it, but the behavior is identical. It selects the symbol in the schematic, but the selection options do not update. @JLCPCBsupport It was there, the very last line. But thank you to make sure I understood. I've made a video to better highlight my the issue I'm facing: [https://youtu.be/4dvvvDSYzDM](https://youtu.be/4dvvvDSYzDM)
Reply
UserSupport 4 years ago
Hi issue confirmed, it is a bug, we will fix it at next 2 releases. Thank you for your report!
Reply
UserSupport 4 years ago
@wolfvanh Hi We release v6.4.5 fixed this issue, please try again.
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