[comp.graphics] Coords --->> AutoCAD ???

fleming@uxh.cso.uiuc.edu (07/20/90)

	Is there a way in AutoCAD 10 to import straight ASCII numbers as
	coordinates?  I have a file of XYZ coords and I'd like to get an
	AUTOCAD drawing made from them (it's a topographic map).

	Thanks!

	D

sun@me.utoronto.ca (Andy Sun Anu-guest) (07/21/90)

In article <11800012@uxh.cso.uiuc.edu> fleming@uxh.cso.uiuc.edu writes:
>
>
>
>	Is there a way in AutoCAD 10 to import straight ASCII numbers as
>	coordinates?  I have a file of XYZ coords and I'd like to get an
>	AUTOCAD drawing made from them (it's a topographic map).
>
>	Thanks!
>
>	D

There is no such command in AutoCAD Release 10 as to import ASCII numbers
as coordinates, but its 'script' command can almost do what you want.
The script command takes a file which contains AutoCAD commands as if you
will type in using the keyboard and perform the command operations. What
you have to do is to get your coordinates in the right format and generates
a script file out of it.

For a topographic map, I guess all you need is line. Since Release
10 supports true 3D for this command, you can simply enter (x,y,z) at
commands instead of using the elevation command to change your z level. What
I suggest you to do is to write a little filter program using your favorite
language to do the following:

(1) takes the xyz coordinates from a file and arrange them according to
    ascending or decending order of z.
(2) write the output to a file in AutoCAD as a script file. Look up the
    manual for examples of a script file. It is actually quite easy 
    in your case, something like

	LINE 
        x1,y1,z1
        x2,y2,z2

        LINE
        x2,y2,z2
        x3,y3,z3

        ....

Make sure that there is no space between the comas, AutoCAD doesn't like
it. You can get away with it easily by using exponential notations.
This solution is not painless, but it's not difficult also. 

Andy

_______________________________________________________________________________
Andy Sun                            | Internet: sun@me.utoronto.ca
University of Toronto, Canada       | UUCP    : ...!utai!me!sun
Dept. of Mechanical Engineering     | BITNET  : sun@me.utoronto.BITNET

nwatson@enuxha.eas.asu.edu (Nathan F. Watson) (07/24/90)

In article <90Jul20.225710edt.20287@me.utoronto.ca>, sun@me.utoronto.ca (Andy Sun Anu-guest) writes:
> In article <11800012@uxh.cso.uiuc.edu> fleming@uxh.cso.uiuc.edu writes:
> >
> >	Is there a way in AutoCAD 10 to import straight ASCII numbers as
> >	coordinates?  I have a file of XYZ coords and I'd like to get an
> >	AUTOCAD drawing made from them (it's a topographic map).
> 
> There is no such command in AutoCAD Release 10 as to import ASCII numbers
> as coordinates, but its 'script' command can almost do what you want.

If you aren't able to or don't want to change the original file's
format, and don't want to write a program to change the format into
the suggested

> LINE
> x1,y1,z1   etc.

form, you might try using the AutoLISP language.  The language includes
file-manipulating functions, a direct interface to AutoCAD commands,
and isn't too bad after you get used to it.  Using AutoLISP and the
direct interface to AutoCAD was more convenient that using other
languages to convert to the .DXF format.

---------------------------------------------------------------------
Nathan F. Watson                             Arizona State University
nwatson@enuxha.eas.asu.edu                Computer Science Department