- I'm exporting some GIS data out of my GIS and into an .AI export. It contains a roads data layer. When I do this the road centerlines as well as sides get exported and they are for the most part on top of each other. I need to be able to reduce the huge file size by eliminating the duplicates. In my lasing software there is a tool to remove overlapping lines and an offset that I can say within .1mm or whatever. Very useful. If I can do this in CorelDraw 2020 it would be much better as the file size will decrease dramatically. These are lines, not shapes. Illustrator does not do this and no plugins exist to remove them as far as I've found. Any ideas? Thanks in advance
Dean Forss
GIS Scientist - Cartographer
Hello Dear
I have created code that can remove duplicates with same position, and same size.
Please note, if there is any circle and a rectangle, with same size, and position, it will remove one of them.
you may give it a try:
Sub removeduplicate()
ActiveDocument.ClearSelection
Dim sn As Integersn = ActiveLayer.Shapes.CountDim x1#, x2#, y1#, y2#, w1#, w2#, h1#, h2#Dim sr As ShapeRangeSet sr = ActiveDocument.CreateShapeRangeFromArray()
For i = 1 To snActiveLayer.Shapes(i).GetPosition x1, y1ActiveLayer.Shapes(i).GetSize w1, h1 For j = i + 1 To sn ActiveLayer.Shapes(j).GetPosition x2, y2 ActiveLayer.Shapes(j).GetSize w2, h2 If x1 = x2 And y1 = y2 And w1 = w2 And h1 = h2 Then ActiveLayer.Shapes(j).AddToSelection End Ifx2 = 0y2 = 0w2 = 0h2 = 0Next jx1 = 0y1 = 0w1 = 0h1 = 0Next iActiveSelectionRange.DeleteEnd Sub
Can I make a suggestion. Very often I have duplicates on different layers, for a very valid reason. I think any macro should check to see if they are on another layer and then NOT delete them?