text to dxf conversion

Hello All,

WARNING: newbie

I'm trying to check out the design for a solar concentrator, but alas am unable to figure out how to convert the text file containing the bare-bones measurements to a DXF for viewing in my CAD tool (qcad). The 27k text file can be seen here:

formatting link
I appreciate the help!

Happy New Year!

-mt

Reply to
mt
Loading thread data ...

Maybe I'm just dense, but what the &%^$ is that file supposed to be? It looks like mostly a simple coordinate file. Where did that information come from?

Reply to
TomD

Yes, it's a file containing a numbered list of coordinates for drawing lines, etc. I think it can be used in a 'script' file, perhaps?

However, I can't believe it's just straight lines and it doesn't contain any dxf format or headers.

The real question is - how to get that information into AutoCAD?

Reply to
B. W. Salt.

The page from whence this CAD file is linked reads "This file can be modified to be compliant with most CAD programs". That page is

formatting link
Hmmm... wonder what the modification is that's required.

thx again,

-mt

Reply to
mt

Having Dxfed files before I can tell you that "From My experiance" It seems there are alot of "Machine" languages out there and this file might have been placed in the wrong association.... I think we are probably looking at the file in that way....just a guess... Maybe I should go look at the file before I shoot my mouth off huh?.....LOL :) BRB

Reply to
Brendan

Yes I'ld say that's just Xand Y co-ordinates from a CNC machine language and furthermore never going to be able to be "seen" ever ever again LOL!!!

Reply to
Brendan

Cartesian coordinates thay are. Not from a CNC though. No code. The points in this file could be plotted in Autocad but, as there is no indication of start/stop points, it would be quite the trick to connect the points into anything meaningful.

Reply to
CW

3D!

Is it a file containing contour points, perhaps?

Reply to
B. W. Salt.

HiHO All; They are Pt.Num X Y Z and when inserted into a autocad drawing they show a solar concentrator with a probe and some point approximatly

6000 feet away. The simulated sun? I sent the drawing, R14, to newbie and hope it helps him. Since the points arn't in order my software wont connect it properly. A mesh dropped on the points could be shaded and displayed as a 3d concentrator.

Reply to
bestafor

This is my idea:

The first part (until 9999 9999 9999 9999) defines indeed just 406 points. The next part (after the 9999 9999 9999 9999 separator) is a numbered list of connections: connection 1 connects point 1 and 2 with color 2. connection 2 connects point 3 and 4 with color 2 etc... There are thus 697 lines, connecting the 406 points.

3 different colors are used.

I have not tried it out in Autocad so far.

Ben.

"B. W. Salt." schreef in bericht news: snipped-for-privacy@monachorum.compulink.co.uk...

Reply to
Ben

There's the rub! How to try it out without entering all the data manually. Interesting analysis of the data, though. You could be right.

Reply to
B. W. Salt.

Using ascpoint.lsp (an old LISP from Tony Tanzillo) at first I draw a point at each of the coordinates of the first part. In a 3D view I could see that the points form a solar concentrator (at least nearly) and I thought they must be connected to 3DFACES. But in the second part of the source file (1 2 2, 3 4 2, ...) I could not find any sense. After reading your posting I connected the points in the way you suggested (with a little LISP). But what do we do with this bunch of lines? (I can't attach the result because this ng doesn't allow binary files)

Juergen

BTW: the point# 6 is not used.

Ben schrieb:

Reply to
Jürgen Palme

Aha! That is it. The first part of the file is a list of points in space. The second part of the file is a list of triangles made from these points in space.

Maybe.

So the second part are lists of indices into the first part. This is just how meshes are organised in DXF files...

--

formatting link
- Easy graphics effects Gliftic - Easy decorative tilings

Reply to
PR

PR schrieb:

OK

OK, until here.

No, that I can't believe. The third value in each line of the second part is only 1 or 2 or 3. It makes no sense, that all triangles should be connected to the point 1 or 2 or 3. I'd agree to Bens interpretation, that the last value in each line of the second part can be a color code (maybe) and the first two values are the numbers of the startpoint and endpoint coordinate of a line..

Juergen

Reply to
Jürgen Palme

I wrote the following quick and dirty VBA code to verify my interpretation which seems to be correct: (first part are point definitions, second part are lines connection them) Copy and paste the following two routines in the VBA editor and run subroutine readpoints. It produces a wireframe which looks like a parabolic collector. However, it looks quite poor and it seems to me this dates from the early years of CAD.

kr Ben.

Private Sub ParsePoints(line As String, ByRef posx As Double, ByRef posy As Double, ByRef posz As Double)

i = 2 While Mid(line, i, 1) " " i = i + 1 Wend While Mid(line, i, 1) = " " i = i + 1 Wend sstr = "" While Mid(line, i, 1) " " sstr = sstr + Mid(line, i, 1) i = i + 1 Wend posx = Val(sstr) While Mid(line, i, 1) = " " i = i + 1 Wend sstr = "" While Mid(line, i, 1) " " sstr = sstr + Mid(line, i, 1) i = i + 1 Wend posy = Val(sstr) While Mid(line, i, 1) = " " i = i + 1 Wend sstr = "" While Mid(line, i, 1) " " sstr = sstr + Mid(line, i, 1) i = i + 1 Wend posz = Val(sstr)

End Sub

Private Sub ReadPoints()

Dim TextLine As String Dim x As Double Dim y As Double Dim z As Double

Dim BeginPoint(0 To 2) As Double Dim EndPoint(0 To 2) As Double Dim PointList(0 To 1000, 0 To 2) As Double

'put the correct file location here Open "D:\Documents and Settings\......\matrix.txt" For Input As #1

'to distinguish between the first part of the file (point defs) and the last part(line defs) ImportingPoints = True PointNumber = 1 While Not EOF(1) Line Input #1, TextLine 'Debug.Print TextLine Call ParsePoints(TextLine, x, y, z) If ImportingPoints Then If x 9999 Then PointList(PointNumber, 0) = x PointList(PointNumber, 1) = y PointList(PointNumber, 2) = z PointNumber = PointNumber + 1 Else ImportingPoints = False End If Else If x 9999 Then BeginPoint(0) = PointList(x, 0) BeginPoint(1) = PointList(x, 1) BeginPoint(2) = PointList(x, 2) EndPoint(0) = PointList(y, 0) EndPoint(1) = PointList(y, 1) EndPoint(2) = PointList(y, 2) Set LineObject = ThisDrawing.ModelSpace.AddLine(BeginPoint, EndPoint) LineObject.color = z LineObject.Update End If End If Wend

Close #1

End Sub

"Jürgen Palme" schreef in bericht news: snipped-for-privacy@debitel.net...

Reply to
Ben

Ben schrieb:

I got also the wireframe model of this "object". Because I'm not so familiar with VBA I wrote some lines LISP, but I guess we see the similar results. (If someone is interested I can post the LISP code I used). We interpreted the first two values of each line in the second part as startpoint and endpoint of a line and not - as PR suggested - as "a list of triangles made from these points in space". This was my point. And my other question was: what can we do with this wireframe model, what is it useful for?

Juergen

Reply to
Jürgen Palme

I tried ascpoint.lsp by removing the line numbers from part of the txt file and adding the required values to the file. By that I mean converting a 0 into 0.0 and so on. I did that for the first 200 lines.

Unfortunately, I could not get ascpoint.lsp to open the file. Kept giving "can't open the file" error messages!

Reply to
B. W. Salt.

"B. W. Salt." schrieb:

OK, I did it too

This is not necessary. 0 = 0.0

1.: Maybe you must specify the path where the source file is stored ("C:/DIR1/DIR2/.../textfile.txt"). Use a slash (/) or two backslashes (\\). 2.: In the original source file the columns are separated by tabulators. ASCPOINT.LSP can't read tabs. You must find all tabs and replace them by a space (this can be done in nearly each text program).

HTH Juergen

Reply to
Jürgen Palme

It is, according to the text that accompanies the lisp file. States it as a 'must'!

It's in the ACAD search path, so it should have found it, but I will try the total path.

Ah! That I did not discover. I'll check that. Thanks.

Reply to
B. W. Salt.

"B. W. Salt." schrieb:

I know, Toni wrote "Note that all numeric values must have at least one digit to the left and the right of the decimal point", but you can believe me, in this case it's not necessary to convert all "0" to "0.0". Try it ...

Juergen

Reply to
Jürgen Palme

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.