What's new
What's new

Want to extract Excel data OUT to DWG or DXF or directly to CAD

Zahnrad Kopf

Diamond
Joined
Apr 5, 2010
Location
Tropic of Milwaukee
I have a need to find a fast, easy, and automated ( if possible ) solution to exporting text values ( point coordinate data** ) OUT from Excel, and IN to CAD. This can be DWG, DXF, or even directly into CAD.

I cannot simply export the whole sheet as a space delimited file. There is a metric buttload of data in it that comprises 90% of it and I only want the 10% that are coordinate points. This is a recurring need, hence the desire to automate it.


Is anyone aware of a program that will do this?

** - actually, they are three point arc values. However, I am willing to construct the arcs myself if necessary if I can successfully obtain the points.
 
Last edited:
We used to do it in AutoCAD 11 and 12, DOS version, back in the days. Got away from it since then. Never tried it in any of the Windows versions of CAD. Sorry I can't help.
 
I have a need to find a fast, easy, and automated ( if possible ) solution to exporting text values ( point coordinate data** ) OUT from Excel, and IN to CAD. This can be DWG, DXF, or even directly into CAD.

I cannot simply export the whole sheet as a space delimited file. There is a metric buttload of data in it that comprises 90% of it and I only want the 10% that are coordinate points. This is a recurring need, hence the desire to automate it.


Is anyone aware of a program that will do this?

** - actually, they are three point arc values. However, I am willing to construct the arcs myself if necessary if I can successfully obtain the points.

If CSV will work for you, and you just have too much data - why not link the relevant cells over to a new sheet and export that sheet?
 
If you had (or access to) UG NX you can import a *.txt file into a file as points or create a spline using the points.

If you had Cadkey there's a way of editing the excel file so it can be read in as a *.cdl file. That would work in Surfcam as well. Or probably any program that recognises cdl files

Never needed to automate the process as I didn't do it very often
 
We did this for to create patient-specific brass compensator disks for proton therapy. The goal was to cut a hole of a certain shape, based on the tumour cross section, in the brass disk. The planning software exported a CSV like this:

"C:\Proton\Patient Data\Mil Files\15#### PATIENTNAME v1.mil"
"15/0003","NAME Patient","Left"

-7.322581, 0.102077
-7.477895, 1.342113
-7.348467, 4.015940
-6.649557, 6.689767
-5.329392, 9.247341
-4.060999, 10.526130
-2.352551, 11.184900
-0.540561, 11.068640
......

Using a Matlab script, the header was stripped off and it was turned into an nc file that looked like this:

G00 X0 Y0
G01 X-0.27487 Y-0.001135
G01 X-0.29561 Y0.046387
G01 X-0.2842 Y0.16159
G01 X-0.23443 Y0.25375
G01 X-0.13179 Y0.33584
G01 X0.0050775 Y0.40064
G01 X0.069362 Y0.4136
G01 X0.11395 Y0.40064
......

The numbers change here as we convert from metric to inches (divide by 25.4) as it's the default for Omax Layout and was (mildly) preferred by the machine shop. Any of this could be done in Excel instead of Matlab by the way. We then opened the .nc files in Omax Layout which we have a site license for because we have an Omax waterjet cutter. Layout is an excellent simple CAD program that can open from a long list of file formats. This allowed the treatment planning people to open and look at the shape of the compensator cutout to make sure it agreed with the planning software. At that point it was saved as a DXF and sent to the shop for CNC Milling or waterjet in the brass blanks. Ironically, for milling it then went into MasterCAM but as noted the key was for the planners to review the shape before sending it to the shop. Otherwise I'm sure you could open the NC file direct in MasterCAM.

This is also super easy in Solidworks. You use "Curve Through XYZ Points". The file needs to be of the format:

-7.322581 0.102077 0
-7.477895 1.342113 0
-7.348467 4.015940 0
-6.649557 6.689767 0

So no commas and you add the Z dimension but it just draws the curve around the points. We did not use this method with planning as it would have required the physicists to learn some Solidworks and also require buying more licenses just for this. (See the attached image - the table creates the central hole)

Solidworks Points Import.jpg
 
I have a need to find a fast, easy, and automated ( if possible ) solution to exporting text values ( point coordinate data** ) OUT from Excel, and IN to CAD. This can be DWG, DXF, or even directly into CAD.
----

How are the point coordinates determined? By calculation within excel or input from another source such at in csv? Will your machine accept a point file directly or must it be processed through another program?

Tom
 
How are the point coordinates determined? By calculation within excel or input from another source such at in csv? Will your machine accept a point file directly or must it be processed through another program?
Tom

Calculated within the spreadsheet. LOTS of them. Not a handful.

I have a couple scripts that do this with Visual CADD. It's a really flexible program, but 2D only. I also used to do it with its predecessor, Generic CADD.

This actually IS 2D. But it can not be tied to any one CAD. Period. I'm not negotiable on that. Hence the desire for platform unspecific form. DWG/DXF have come to be universally processed, so that's why I'm open to those. Plus, that seems to be generally normal for spreadsheet exporting these days.

Thanks.
 
I remember doing this in the past by just creating my own DXF file. If you can program in just about any language, it's not too difficult. The structure of a DXF file is simple, or can be. Just write a generic header and stick the data in. Another cheat is to start with some existing DXF file and insert your own data. I write stuff like this in BASIC because it's what I know, but no doubt Python or whatever the kids are using today, would do fine. You could also use the VBA built into Excel to extract the data and write the file. There's actually a VBA for Dummies book I started with.
 
Hey ZK,
This problem was on my mind this morning and I took some time to understand the DXF file structure. Like Conrad mentioned it's pretty simple. I manually created a number of different DXF files from scratch inside a text editor. If you send me something representative of your spreadsheet I'll see if I can make an automated script.
 








 
Back
Top