Automatically drawing circles with specified radius as attribute in CSV-file

Automatically drawing circles with specified radius as attribute in CSV-file

Anonymous
Not applicable
4,438 Views
5 Replies
Message 1 of 6

Automatically drawing circles with specified radius as attribute in CSV-file

Anonymous
Not applicable

Hello,

 

I have a CSV-file with following attributes: ID, X, Y, Z, Radius.

 

Is it possible to import this file in Autocad Civil3D and automatically draw the circles with correct centerpoint and radius?

 

In attachment you can find an example CSV-file, normally it would be hundreds of points.

 

Thanks in advance.

0 Likes
4,439 Views
5 Replies
Replies (5)
Message 2 of 6

Jeff_M
Consultant
Consultant

A small program could be written to do this.

 

Or, you could utilize the C3D Cogopoint import from file but would require a bit of setup. The most difficult part would be editing the text file to use a . in pace of a , for the decimal separator, edit the radius portion so it begins with a text descriptor (such as RP) so it can be used with a Description key file. You would need a point style which uses a circle having a fixed size of 2, and a Description Key set to look for the RP description, uses the circle point style, scales the point x-y from the Parameter 1

 

Here is the result of using the Cogopoint method, which took about 5 minutes to complete:

2-26-2016 7-30-50 AM.png

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 6

Kyle-L
Advocate
Advocate

As an alternative method to what Jeff_M suggested you could create the circles in a bit more manual way just using the CIRCLE command (so this method will work in AutoCAD and Civil 3D.

 

What you need to do is bring the CSV into excel, create a formula to concatenate strings together so the resulting value looks like what you would type at the command line to draw a circle in ACAD/C3D (e.g. C 6.128,7.15,1.06 0.209) and then copy all the cells from excel into the command line in ACAD/C3D to create the circles.

 

Here are the steps:

 

  1. Replace the "," (comma) with a "." (period/full stop) in the CSV (use something like notepad to do a find and replace).
  2. Replace the ";' (semicolon) with a "," (comma )in the CSV (again, use something like notepad to do a find and replace).
  3. Open the CSV in Excel. There will be 5 columns (A to E) with the values in them.
  4. In a cell to the right side of the first entry (ID=2358899 in this case) create a CONCATENATE with the formula: =CONCATENATE("C", " ",B2,",",C2,",",D2," ",E2)
    Concatenate
  5. The above formula results in the following output C 6.128,7.15,1.06 0.209 Notice it is formated like the input the circle command would take:
    1. C - short AutoCAd command for CIRCLE, which is followed by a spce that simulates the Enter key.
    2. 6.128,7.15,1.06 - the coordinate in an X,Y,Z format, again followed by a space to simulate the Enter key.
    3. 0.209 - for the radius
  6. Drag down the formula for all lines in the CSV, then highlight all the resulting values and copy it to the clipboard.
  7. Go into AutoCAD/C3D and paste the contents of the clipboard into the command line. The result is that the CIRCLE command will be called for every line in the CSV and drawn at the correct location and radius.

Here is the result:

Circles.png

 

I have attched the CSV that I "cleaned up", as well as the Excel spreadsheet I created that contains the formula.

Message 4 of 6

Anonymous
Not applicable

Hi HimKyle,

 

I followed your instructions and now have a .csv file (attached) with the formula to draw circle of radius r at xyz location. I am now trying to copy paste the formulas in the command line but not able to do so? I cannot even type "C 18850.5,17700,0 1" in the command line without AutoCAd auto completing and asking me to input circle coordinates and the radius in separate commands (Please see  the screen shot attached here). 

 

I would really appreciate any guidance you can provide here. I am really new to AutoCad ( I just downloaded it after I read your instructions).

 

Thank you so much!

 

0 Likes
Message 5 of 6

Kyle-L
Advocate
Advocate

Hi,

 

I tried your csv and it worked for me. i am using AutoCAD 2016 whereas I see you are using 2019, prehaps that is the problem (although I doubt it is).

 

In Excel did you copy all the filled in cells in column F (except for the header)? Then did you right-click in the command line in AutoCAD and paste from the clipboard?

 

You can see me preforming the procedure in the screencast.

 

I also attached a screenshot and a dwg with the results.

 

 

0 Likes
Message 6 of 6

Anonymous
Not applicable

Dear HimKyle,

 

Thank you so much for your reply. It seems like in AUTOCAD 2019, I had to use CIRCLE instead of C. However even after I changed the command, the copy paste technique you showed didn't work. The AUTOCAD froze each time I pasted the commands. I was finally able to get it to work by saving the commands in notepad with ".scr" extension. Then I typed scr in the command line and it asked me to load the file. After I selected the file, the CAD drew the circles.

 

Thank you again for your help! Your post helped me figure this out.

 

Regards,

Anusha

0 Likes