You need to use EasyEDA editor to create some projects before publishing
Cannot delete shape using API
525 0
MadOverlord 4 years ago
The API documentation does not explain how to delete a shape: [https://docs.easyeda.com/en/API/EasyEDA-API/index.html#Examples](https://docs.easyeda.com/en/API/EasyEDA-API/index.html#Examples) In fact, it says this: **Delete Shapes** **Removing shapes by follow code** Except, there is no code example! In my case, I need to delete a track. I have tried an educated guess, such as: ``` api('deleteShape', {id:'gge13'}) ``` I've also tried just setting the shape to have no points, as in: ```                                 api('updateShape', {                                         "shapeType": "TRACK",                                         "jsonCache": {                                         "gId": t2.gId,                                         "pointArr": []                                     }                                     }); ``` The script I'm writing ought to be very handy for a lot of people. When you're designing and redesigning a board, often your tracks get subdivided. Then when you try and move things around, only part of the track moves; you have to move each subpart and delete any bits that are hanging on. The script does two things: 1. It looks for pairs of tracks that have the same net, layer, and width, and where the start/end of one is also the start/end of the other. It combines them into a single track. 2. Within any track, it looks for triplets of points (a,b,c) that are in line (ie: slope(a,b) == slope(b,c)) and replaces them with the pair (a,c), simplifying the track. I have it completely working except for deleting the redundant track. Much obliged for any help that can be provided.
Comments
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