Importing CSV into AutoCAD 2018 as block and including Point ID on block

Importing CSV into AutoCAD 2018 as block and including Point ID on block

andrew.wheaton
Enthusiast Enthusiast
18,518 Views
23 Replies
Message 1 of 24

Importing CSV into AutoCAD 2018 as block and including Point ID on block

andrew.wheaton
Enthusiast
Enthusiast

Good afternoon.

 

I'm hoping someone can help me.

 

I've been asked to import a CSV file into AutoCAD. I have around 1000 points to plot. My idea is to import the points using the X and Y coordinates from the CSV, and adding a block to each point with an identifying ID as an attribute.

 

Can anyone help me?

 

0 Likes
Accepted solutions (3)
18,519 Views
23 Replies
Replies (23)
Message 21 of 24

leeminardi
Mentor
Mentor

@matthew_fuller46E6T 

There are several problems with the file and an operational one.

  1. The contents of the expression for the formulas in column I leave out the Excel CONCATENATE function!!!  Why did you omit it?
  2. The hyphen in the insert command (i.e., -insert) bypasses the initial dialog box but NOT the dialog box for entering attribute values.  In order to disable this dialog box give the attdia command and set the value to 0.
    ATTDIA  [ENTER]  0
  3. Your data has the blocks very close together. For example, all 18 are here:
    leeminardi_0-1695663845874.pngleeminardi_1-1695663882316.png

    Zooming very tightly into the corner of the block we see the 18 blocks overlapping with a slight offset.

    leeminardi_2-1695663976572.png
  4. Here's the correct content for cell I2.  It can be filled down to for the other rows of data. 

 

=CONCATENATE("(command ",CHAR(34),"-insert",CHAR(34)," ",CHAR(34),A2,CHAR(34)," ", CHAR(34),B2,",",C2,",",D2,CHAR(34)," ",E2," ",F2," ",G2," ",CHAR(34),H2,CHAR(34),")")​


Good luck.

 

lee.minardi
0 Likes
Message 22 of 24

matthew_fuller46E6T
Community Visitor
Community Visitor

Hi Lee,

 

Thank you for the quick reply. The CONCATENATE function was used, exactly as shown, in the example above, its where I got the idea for the spreadsheet I uploaded yesterday.  The script appears to work in that it's creating the blocks, scaling and labeling them correctly. I'm just not certain why the x/y location isn't following suit. I verified the location data accuracy by entering a few of the coordinates manually using the GEOMARKLATLONG command, then entering the coordinates manually. When I do this manually, the locations appear as they should, in the correct locations. 

0 Likes
Message 23 of 24

leeminardi
Mentor
Mentor

@matthew_fuller46E6T   I have very limited experience working with the geomarker features of AutoCAD so please keep that in mind with my following comments. 

 

I think the problems you are facing may have to do with  mixing x,y with latitude, longitude when it should be longitude, latitude, and your use of units.  That is, longitude can be considered a horizontal coordinate (i.e., "X") and latitude a vertical coordinate ("Y").   What you have in your spreadsheet labeled as X is latitude, should this not be a Y coordinate and vise versa for the column labeled a "Y"? 

 

Swapping the x and y coordinates seems to provide results that yield a better correlation except for a scaling factor. 

 

As for units and I am sure you are aware, latitude and longitude are not uniform or even linear scales.  I do not know what fudging and tricks AutoCAD makes to compensate for this fact. Before using the spreadsheet data I would change the AutoCAD units to decimal with 8 decimal places.

 

Perhaps you should consider modifying the Excel worksheet to use the geomarklatlong command rather than inserting blocks.

lee.minardi
0 Likes
Message 24 of 24

Pointdump
Consultant
Consultant

Hi Matthew,
Welcome to the Autodesk Forums.
Some observations. Your drawing is a heavily conflicted Civil 3D drawing.
The C3D units are decimal feet and the assigned coordinate system is MA83F, but you have the Transformation Tab turned on and using wildly inappropriate numbers, which wrecks the coordinate system. The AutoCAD units are Engineering, which is decimal inches. Your data is in Decimal Degree Longs and Lats.
Step one to fixing things is to take your drawing out behind the chemical sheds and have it shot. Then in your new drawing use consistent units.
Please post this in the >>>Civil 3D Forum<<< and folks there can show you how to import those points as COGO Points. It's much easier than an Excel Script.
Dave

 

MA_Pts_1.png

 

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2025