DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Generating line from CSV file

Started by BN45, May 03, 2019, 10:14:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BN45

I was drawing the curve of an airfoil by manually entering each point from a table of data points, which then started me looking through the forum for a way to possibly read the values directly with a macro.  I did come across some posts indicating this can be done with a CSV file, but I was unable to find any reference material explaining (at the newbie level) how to do this, or if a macro for doing this is already available.  Any help would be greatly appreciated.  Thanks.

Dr PR

#1
You can import XYZ files, with several options. Look for XYZ in the index of the reference manual.

It has been a while since I last did this, but I think the file format is this (be sure to look this up):

XXX.XX,YYY.YY,ZZZ,ZZ(line end)
XXX.XX,YYY.YY,ZZZ,ZZ(line end)
XXX.XX,YYY.YY,ZZZ,ZZ(line end)
line end
XXX.XX,YYY.YY,ZZZ,ZZ(line end)
XXX.XX,YYY.YY,ZZZ,ZZ(line end)
XXX.XX,YYY.YY,ZZZ,ZZ(line end)
line end

NOTE: "line end" means the end of the row in the file - the same as the "Enter" key.

where each separate point X, Y and Z values are a row in the file,
successive points make up a line/curve,
and a "blank line" in the file (line end) terminates a line/curve and starts a new vector/curve.

You have choices in the XYZ import function to just have each point be a separate point, be a part of a line/vector, or be part of a curve.

For 2D files just leave out the Z value, or better still, make all z values zero.

Phil

PS: The Reference Manual is in the folder where DesignCAD is installed. It is the file

DcadXX.pdf

where XX is the version of DesignCAD.
DesignCAD user since 1987

BN45

That worked quite nicely.  The only difficulty I had was finding the CSV file when I looked for it using the File\Import.  Since it isn't a normal drawing file it doesn't show up in the list of available files.  However, if you start typing the name of the file in the Filename box, it will then popup and you can select it.  Thanks so much for your help! :D

Dr PR

Oops!

I forgot to mention that the file should be renamed to type ".xyz." That's what DesignCAD's import function looks for.

Glad you were able to import the data.

Phil
DesignCAD user since 1987