Hi,
I need your help how to export object coordinates to file readable in xls or simple txt file but in x,y format, not the matrix. I've already done the export to *.svg file and I can read it in notepad or excel, but how can I transform this data from matrix to simple x,y?
I have hundreds of objects and I need to do this as fast as it possible.
I'll be grateful for all your help.
There are other "simple" formats like DWG but I am not sure whether they would be any closer to what you want.
Can you give a short extract of data actually from the SVG file and how you would like to see it? In particular, what type of objects are you looking at, and how many co-ordinates from each object are you expecting?
My first thought is that this might be a job for a macro, which could produce the data in exactly the format you need.
I have 500 of circles (elipses) and I need to extract x,y coordinates of them. The best option would be txt file or other format that will be able to open with Excel.
I've exported svg file and I have something like that:
transform="matrix(0.965926 0.258819 -0.258819 0.965926 11500.8 153.999)" r="459"
while in corel, coordinates of this circle are: x: 115,008 mm and y: 1,0 mm.
I can see that in this matrix x-value is correct, but what I need is to export my cdr file as a list of objects with x,y coordinates.
As a macro, I think you would need something like this ...
Private Sub CommandButton1_Click() Dim s As Shape ActiveDocument.Unit = cdrMillimeter TextBox1.Value = "ID" + vbTab + "Name" + vbTab + "X" + vbTab + "Y" + vbTab + "Width" + vbTab + "Height" + vbLf For Each s In ActiveDocument.SelectableShapes.All If s.Type = cdrEllipseShape Then describeCircle s End If Next s txt = TextBox1.Value End SubSub describeCircle(s As Shape) Dim txt As String txt = "" 'optional inclusion of item ID and name txt = txt + Trim(Str(s.StaticID)) + vbTab + Trim(s.Name) + vbTab 'X and Y coordinates txt = txt + Trim(Str(Round(s.CenterX, 3))) + vbTab + Trim(Str(Round(s.CenterY, 3))) 'optional addition of width and height txt = txt + vbTab + Trim(Str(Round(s.SizeWidth, 3))) + vbTab + Trim(Str(Round(s.SizeHeight, 3))) TextBox1.Value = TextBox1.Value + txt + vbLfEnd Sub
Result:
You need a version of CorelDraw that supports VBA (eg the retail version, not Home and Student) to run macros.
Put the attached file in your GMS folder (probably %appdata%\Corel\CorelDRAW Graphics Suite X6\Draw\GMS) and you should then see DescribeCircles listed in Tools > Macros > Run Macro.
At the moment, the results appear only in the textbox, but they are already tab delimited so you can paste them into a CSV file and should be able to open it in excel.
You may not want the "optional" columns, but can delete them by removing the line after the comment. I put them in because they might be useful to somebody else.