Cannot delete shape using API
64 0
MadOverlord 2 months 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
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.