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)
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.
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.
@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);
```
@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.
@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 :)
@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)
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