You need to use EasyEDA editor to create some projects before publishing
API scripting does not seem to work
1584 7
pvbmstu 9 years ago
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.
Comments
dillon 9 years ago
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 });
Reply
lmatsiev 8 years ago
Is there any progress with the new API tutorial? Is there a similar example as to how an arc can be created programmatically? Thanks! @dillon
Reply
dillon 8 years ago
@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 } }); ```
Reply
lmatsiev 8 years ago
@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.
Reply
lmatsiev 8 years ago
@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!
Reply
dillon 8 years ago
@Lmatsiev Yes, it is an issue, Thanks for your report
Reply
eric 8 years ago
This api issue was fixed since version 3.4.2
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