The API documentation does not explain how to delete a shape: 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.

#Bug Reports#
#BugReports#
Bug Reports

No comments yet. Be the first to comment!