Hello.
The tutorial code (the one with flowers) does not work for me. Nothing happent as I go "Run script", paste it and run. Any clue is the issue?
My browser is Google Chrome if thing matters.
Hi,
We just release a new API, not read to update the tutorial. insert method merge to create
api('createShape', {
"shapeType": "arrowhead",
"x": 300,
"y": 300,
"color": "#339933",
"size": "3",
"rotation": 0
});
@Lmatsiev
help file https://easyeda.com/Doc/Tutorial/API.htm#Create-Shape.
This is a PCB script, open your PCB and do some test. the unit is 10mil
```
var result = api('getSvgArcPathByCRA', {cx:100, cy:100, rx:90, ry:90, startAngle:0.1, endAngle:0.7, sweepFlag:1});
api('createShape', {
"shapeType": "ARC",
"jsonCache": {
"layerid":"3",
"net":"",
"d":result ,
"strokeWidth":1
}
});
```
@dillon Thanks much, it works. Your Easyeda project is a true game changer in EDA/CAD space and will certainly make history. Full-fledged scripting capability would definitely help Easyeda on its path to stardom.
@dillon The example from https://easyeda.com/Doc/Tutorial/API.htm#UpdateShape:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Move selected objects from left to right in 20pixel or 200mil step
api('moveObjs', {addX:20});
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
does not seem to work. Regardless of the value in addX:, the selected objects are getting "jammed" into the upper edge of canvas. Steps to reproduce:
1. Open New PCB
2. Draw some arbitrary object (hole, rectangle trace, etc.) near the origin and select it
3. In "Run Script Code..." window execute the following "api('moveObjs', {addX:20});" or even "api('moveObjs', {addX:0});"
4. See where the object ends up by going to zoom, Fit in Window
Thanks!
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