Enter hundreds of 3D polar coordinates to create a wire frame from an ascii file

Enter hundreds of 3D polar coordinates to create a wire frame from an ascii file

PBESSmgr
Participant Participant
1,176 Views
6 Replies
Message 1 of 7

Enter hundreds of 3D polar coordinates to create a wire frame from an ascii file

PBESSmgr
Participant
Participant

What format and data arrangement is needed in what type of file to enter hundreds of 3D polar coordinate points somewhat automatically in AutoCAD 2016? Can AutoCAD be trained to read my ASCII file as is or do I have to re-arrange the file? Are there routines that can be instructed to re-arrange the data as needed? What are the steps to entering the data into an existing drawing once the file is created? This data is in a format of

depth h

8 radii at 2.8125 degree intervals from North to 19.6875 degrees NNE

8 radii at 2.8125 degree intervals from 22.5 deg NNE to 42.1875 degrees NE

8 radii at 2.8125 degree intervals from 45 deg NE to 64.6875 deg ENE,

etc. all the way around the compass 0 to 357.1875 then repeated for the next depth.

128 radii around the compass for each depth. There can be 100 depths.

This traces a series of irregular shaped discs at regular depth intervals.

0 Likes
1,177 Views
6 Replies
Replies (6)
Message 2 of 7

leeminardi
Mentor
Mentor

Use Excel to create a script file to create the curve.

 

For example, setup an Excel file as shown below that converts the r, angle, depth values to x,y,z then use the Excel concatenate function to create an expression with the coordinates separated by commas.  Copy the values into Notepad and add the command 3dpoly (for 2d or 3d geometry) or pline (for 2d geomentry)  at the beginning.

 

a1.JPG

 

Save the file as a text file but with an extension of .scr.

a2.JPG

 

Use the script command in AutoCAD to create the geometry.

lee.minardi
Message 3 of 7

PBESSmgr
Participant
Participant
Thanks. Is the manipulation of this ASCII text file something that can be done in LISP within AutoCAD or must it always be done in Excel?

I think it would take several hours to manipulate each of these files in Excel. Is LISP difficult to learn and is it just script files for several AutoCad commands?
0 Likes
Message 4 of 7

PBESSmgr
Participant
Participant
Thanks. Is the manipulation of this ASCII text file something that can be done in LISP within AutoCAD or must it always be done in Excel?

I think it would take several hours to manipulate each of these files in Excel. Is LISP difficult to learn and is it just script files for several AutoCad commands?
0 Likes
Message 5 of 7

leeminardi
Mentor
Mentor

The LISP language in AutoCAD is a full blown programming language with a steep learning curve. You can do almost anything with with it in AutoCAD.  I would steer you away from it unless you can get someone to write the program for you.  

 

You could create one Excel file to create a script file that outputs the data for all your curves including the 3dpoly or pline commands.  If you are comfortable with Excel/VBA you could use it to create the AutoCAD script file.

 

What is the format of your data now? 

 

Attached is an example of an Excel/VBA file that I recently programmed. It creates an scr file.  File in the part number, x,y,ang cells and the program generates a .scr file.

 

 

 

lee.minardi
0 Likes
Message 6 of 7

PBESSmgr
Participant
Participant

The hard work will be converting all the polar data to absolute xyz in excel. Can a set of points be plotted, then draw lines point to point without re-entry of coords? If so maybe the UCS can be changed for each set of 128 points at each z depth and the polar coordinates could be plotted as relative points from the UCS 0,0? The format of data now is a text dump organized with general info then radii data for each depth and 2.8125 degree angle around the compass. Examples below. R@N is radii at North (0 deg); then eight radii at an angle from north increased by 2.8125 deg;  R@NNE is radii at 22.5 deg east of North; and so on. 

Date: Sat, Mar 04, 2017 02:37Z
 Customer: xxxxxx
 Description: Cavity
 Station_count_maximum: 304
 Station_depth_resolution: 1
 Station_depth_minimum: 2053
 Station_depth_maximum: 3235
 Station_0_file_offset: 972
 File_format_version: 201

 Station#: 1
 Depth: 2040
 Tilt: 0
 VOS: 5985
 S_uS:   14.0
 Avg_r: 38
 Spare: 40f93a95
 R@N:     1.5   1.5   1.5   1.5   1.5   1.5   1.5   1.5
 R@NNE:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@NE:    1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@ENE:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@E:     1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@ESE:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@SE:    1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@SSE:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@S:     1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@SSW:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@SW:    1.5   1.5   1.5   1.5   1.5   1.6   1.6   1.6
 R@WSW:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.6
 R@W:     1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.5
 R@WNW:   1.5   1.5   1.5   1.5   1.5   1.4   1.5   1.5
 R@NW:    1.5   1.5   1.5   1.6   1.6   1.6   1.6   1.6
 R@NNW:   1.6   1.6   1.6   1.6   1.6   1.6   1.6   1.5
 EOS: 1

 

Station#: 118
 Depth: 3077
 Tilt: 0
 VOS: 6026
 S_uS:  244.0
 Avg_r: 144
 Spare: 470969d5
 R@N:   101.5 100.7 101.5 100.7  98.5  98.5  98.5  98.5
 R@NNE:  98.5  98.5  98.5  98.5  98.5  98.5  98.5  97.8
 R@NE:   97.8  99.2 100.0 100.0  99.2  99.2  99.2  97.8
 R@ENE:  98.5  99.2  97.8  97.8 100.0  98.5 100.7 100.0
 R@E:    99.2 102.2 102.2 102.9 102.2 101.5 101.5 100.0
 R@ESE: 100.7 100.7 111.7 110.3 111.0 107.3 105.9 105.1
 R@SE:  102.9 105.9 104.4 106.6 106.6 107.3 105.9 107.3
 R@SSE: 105.9 107.3 108.1 107.3 107.3 108.1 108.1 108.1
 R@S:   108.8 111.0 110.3 111.0 112.5 113.2 114.0 115.4
 R@SSW: 116.9 119.8 118.4 117.6 111.0 111.0 110.3 110.3
 R@SW:  110.3 111.0 112.5 112.5 112.5 112.5 111.0 111.7
 R@WSW: 110.3 111.0 112.5 111.7 112.5 112.5 111.7 110.3
 R@W:   109.5 109.5 109.5 109.5 108.8 110.3 108.1 108.1
 R@WNW: 108.8 109.5 107.3 107.3 108.1 105.9 106.6 105.9
 R@NW:  106.6 106.6 105.1 105.9 105.1 103.7 102.2 102.9
 R@NNW: 103.7 102.2 101.5 102.9 101.5 101.5 101.5 101.5
 EOS: 118

0 Likes
Message 7 of 7

leeminardi
Mentor
Mentor

The attached Excel file contains a VBA program to create a script from your data.  You must first transfer the data to Excel and delete extraneous rows.  I used the Excel text to columns feature to layout the data as seen in the attached file.  A new 3d polyline is created for every depth listed in column A.  The program stops when it finds a blank cell after a set of point data.

 

Try out the program and let me know if you have any questions.

 

Lee

lee.minardi
0 Likes