parameters lOverDraw if parameters() < 1 lOverDraw = .f. endif if !lOverDraw clear endif set talk off close all do while .t. infile = getfile("DXF") if empty(infile) exit endif outfile = left(infile,rat(".",infile))+"XYZ" =convert(infile,outfile) lOverDraw = .t. enddo function convert parameters infile, outfile h1 = fopen(infile) create cursor tXYZ (x1 n(10,6), y1 n(10,6), z1 n(10,6), x2 n(10,6), y2 n(10,6), z2 n(10,6)) do while !feof(h1) msection=upper(alltrim(fgets(h1,500))) if msection = "LINE" =getxyz() endif enddo =fclose(h1) h2 = fcreate(outfile) select tXYZ calculate max(x1), max(x2) ,max(y1), max(y2) to maxx1, maxx2, maxy1, maxy2 nConst = _screen.height / max(maxx1, maxx2, maxy1, maxy2) _screen.forecolor = iif(lOverDraw,rgb(255, 0 ,255),rgb(0,0,0)) go top _screen.pset(x1*nConst,y1*nConst) scan for !(x1 = x2 and y1 = y2) =fputs(h2,str(x1,10,6)+","+str(y1,10,6)) =fputs(h2,str(x2,10,6)+","+str(y2,10,6)) _screen.line(x1*nConst,y1*nConst) _screen.line(x2*nConst,y2*nConst) endscan =fclose(h2) function getxyz do while !feof(h1) m.firstid = alltrim(fgets(h1)) if isalpha(m.firstid) if m.firstid # "CONTINUOUS" return else loop endif endif if !(m.firstid == "10") && Discard x1 identifier loop endif m.x1 = val(fgets(h1)) if !(alltrim(fgets(h1)) == "20") && Discard y1 identifier loop endif m.y1 = val(fgets(h1)) if !(alltrim(fgets(h1)) == "30") && Discard z1 identifier loop endif m.z1 = val(fgets(h1)) if !(alltrim(fgets(h1)) == "11") && Discard x2 identifier loop endif m.x2 = val(fgets(h1)) if !(alltrim(fgets(h1)) == "21") && Discard y2 identifier loop endif m.y2 = val(fgets(h1)) if !(alltrim(fgets(h1)) == "31") && Discard z2 identifier loop endif m.z2 = val(fgets(h1)) insert into tXYZ from memvar enddoIt writes out a XYZ file (X, Y, Z values for vectors) and draw on screen. If lOverdraw if .f. doesn't clear the screen (to compare a time series drawing).