Importing points from a .CSV to MAP 3D and Using Query

jeguizaASRZM
Enthusiast

Importing points from a .CSV to MAP 3D and Using Query

jeguizaASRZM
Enthusiast
Enthusiast

Hello, I am new to AutoCAD MAP 3D and want to learn about importing information to AutoCAD Map 3D  (specifically using a .csv that has LL84 coordinates). My current coordinate system is UTM83-16F. I am interested in learning how to insert my excel sheet and performing Querys. Can anyone show me methods to do so? I am Trying to use the ODBC DATA SOURCE or Any Other method to be able to insert my information. Can Someone guide me on how to do so and how to use the Query function?

 

0 Likes
Reply
Accepted solutions (2)
8,459 Views
20 Replies
Replies (20)

ChicagoLooper
Mentor
Mentor

Are you sure your lat/longs are correct? What are your lat/longs referenced to? If they are WGS84, then your points are in the Lake, offshore from NavSta GL. The only reason I think you would need to be in the Lake would be to analyze or use bathymetry data. If that's the case, you'd need elevation and your csv doesn't have z-values.

 

BTW, if you want to perform a query, you don't necessarily need an ODBC because there are other ways to query without using an ODBC. However, if you really do, then you'll need to get the ODBC set up which means you'll need to download and install a Microsoft Access Database Engine that allows your dwg to connect to, and communicate with, a csv, xlsx or txt file. There are several MS DB Engines, your selection depends on your Acad version, your MS Office version, and your Operating System version. Picking the correct one is critical. Installing it can be an absolute beast. Make it easy on yourself, put in a ticket and let IT do it.

 

You can even bypass M3D and import your points to Google Earth Pro without any additional formatting to your csv. In GE Pro, go to File=>Import=>Change files of type to Generic Text=>Browse to your csv=>Open. Then, in the Places Panel on the left, scroll down to Temporary Places Section and check the box that has the same name as your csv file.

 

If you still want to perform a query, fix your lat/longs and post again.

Chicagolooper

EESignature

0 Likes

jeguizaASRZM
Enthusiast
Enthusiast

Hello @ChicagoLooper,

Yes my Lat Longs are correct, They where made specifically to identify the lake coordinates for this example. I reference this to Bing's coordinate system that uses the WGS84 to obtain my LAT LONG. In this case I used my z value as "0" since I really don't need elevation. All the coordinates where made up as a very quick example. Thank You for your time!

 

So How can I input my .CSV file into AutoCAD MAP 3D without using the ODBC? And Still perform a Query for example points that have " Light" in the description would those be able to be isolated if I run a Query?

 

I have used Google pro to plot my points, but I'm not sure if I would be able to run a Query. The Biggest thing I'm looking for is to isolate points based on the information inside the points. 

 

Thank you for your help!

Really appreciate your time 

0 Likes

АлексЮстасу
Advisor
Advisor

In my opinion, the points are not in the water, but in the snow - in Antarctica. 🙂
Latitude -87°.


From csv you can load points with many characteristics, albeit through intermediate steps.


But!

Map 3D refuses to convert to a cartesian coordinate system (UTM83-16F) from latitude-longitude (ll84):

"Can't transform point from Lat Long."

This is probably somehow related to the mathematics of Map 3D.

(For example, the Vincenty algorithm has a limit for latitudes from -80° to 84°).

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

jeguizaASRZM
Enthusiast
Enthusiast

I see where the confusion is, my apologies. I go from a ll84 system to a UTM83-16F. I have updated my information with headers. I Format my excel sheet to meet the PENZD format so that AutoCAD recognizes my information using the map import command. I don't know if using the ODBC Will require different formatting. 

Thank You for the Help!!

0 Likes

ChicagoLooper
Mentor
Mentor

@АлексЮстасу wrote:

In my opinion, the points are not in the water, but in the snow - in Antarctica. 🙂
Latitude -87°.

 

LOL! No, no. This is a joke, right?

 

They are not in the snow. You are mixing up longitude and latitude. Latitude is not -87, that's longitude. Latitude is 42.

 

 

 


Map 3D refuses to convert to a cartesian coordinate system (UTM83-16F) from latitude-longitude (ll84):

"Can't transform point from Lat Long."

This is probably somehow related to the mathematics of Map 3D.

(For example, the Vincenty algorithm has a limit for latitudes from -80° to 84°).

 


Can't transform in Map 3D?? Are you sure? I know I can. And I'm sure there's a few other who can too. 

Chicagolooper

EESignature

0 Likes

АлексЮстасу
Advisor
Advisor

You can load points with any number of characteristics. I will consider the example of dwg.
1. Remove the point numbers at the beginning in csv. Or drag them after the coordinates.
2. In dwg install ll84.
3. In dwg create a point block with attributes, the number of attributes is equal to the number of characteristics.
4. In dwg, create an Object Data description with fields of the same names as block attributes.
5. Download lisp Point Manager / PTM. APPLOAD it to AutoCAD. Call the PTM command.
6. Load points in dwg in the form of blocks with attributes. The option Current Point Format - Change allows you to set the reading order of coordinates:

PtM.png
7. Use the ADEGENLINK command to attach the Object Data to the points, loading the contents of the attributes into the OD fields:

ADEGENLINK.png
8. Save, close dwg.
9. Create a new dwg, install the UTM83-16F.
10. MAPWSPACE, ON, Map Explorer tab. Drawings, Attach - dwg with dots.
11. Current Query, Define, Property all Layer, Execute Query:

MAPWSPACE_Execute_Query.png
12. Drawings, Detach - disconnect the dwg source.

 

Items 4, 7 about Object Data can be omitted. It is possible to select according to attribute values. But more convenient by OD.

An example is attached for Antarctica. 🙂

The block, attributes, OD, fields - all just for an example.

 

I could write this right away, but I hoped that someone would know a simpler way...

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

АлексЮстасу
Advisor
Advisor

@ChicagoLooper wrote:

You are mixing up longitude and latitude.


Historically, in navigation, geography, cartography, etc. the first always wrote the latitude. Already 600 years, probably. 🙂
But modern mathematicians and programmers often ignore this or simply do not know.

For example, in our AutoCAD Map 3D in MAPTRACKCS, the first one is not written latitude. Although, when entering on the command line with 'll, first the latitude.
In kml, not latitude is written at first. But in Google Earth, latitude is first written.
And in some other common GIS and formats, not latitude is also written at first.
For gml at some point, they specifically uniquely determined that you must first record the latitude.
Therefore, it is not surprising that points can appear in Antarctica, and in the ocean or in Africa instead of Europe. 🙂


@ChicagoLooper wrote:

Can't transform in Map 3D?? Are you sure? I know I can. And I'm sure there's a few other who can too. 


How do you do this? I have at latitude -87, after the query is executed in UTM83-16F, the coordinates remain the same: 42 ..., -87 ... - i.e. latitude-longitude values remain.

An example of dwg with points in Antarctica I attached in the previous answer.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes

ChicagoLooper
Mentor
Mentor

I, and I'm sure many others, don't care how it's written or displayed in other programs. Map 3D, Civil 3D as well as other GIS programs conveniently provide an option to designate whether it's X/Y or Y/X, whether it's  northing/easting or easting/northing. This is why the formats such as PNEZD and PENZD exists in the first place. Because those programs, and more importantly, the users of those programs need to hit from both-sides-of-the-plate in order to optimize baserunning and scoring situations, not to mention improve batting average.

 

Since the OP already alluded to his points being offshore from Navel Station Great Lakes and in the water, Lake Michigan (the 4th largest freshwater 'pond' on the planet), deductive reasoning would position his points at a positive latitude north of the equator, and a negative longitude or beginning from the prime meridian then traversing westerly across the Atlantic.

 

Any navigator, geographer or cartographer, whether dead or alive, historical or modern, brilliant or not, would ascertain that given the north pole and equator, the the numbers noted above would mean a positive lat and a negative long. Or should it be a negative long and a positive lat?😊

Chicagolooper

EESignature

0 Likes

jeguizaASRZM
Enthusiast
Enthusiast

I am still trying to understand the process? I am struck on the ADEGENLINK because I don't know where the table "www" came from. I Have tried many times to replicate this but I'm lost along the way. Would a screen recording of the process be too much to ask?

 

Thank You for Your help!! 

This is a little longer than what I expected, is there another way to also achieve the result?

 

0 Likes

АлексЮстасу
Advisor
Advisor

The www table came mainly from my left finger - see my item 4. 🙂

ADEDEFDATA - create, edit, delete descriptions of Object Data tables.

 

Yes, I was a little ashamed to offer you all this.
But. Creating Object Data (item 4) can come in handy to you many more times. Point Manager (items 5, 6) too. And data loading by request (items 10-12) with transformation (or without) of the coordinate system - too. And the block with the attributes for the point (item 3) - too.

 

I don’t understand why Autodesk didn’t make a simple import from csv, txt to accept any number of characteristics ... The same Google Earth offers to open almost any csv, txt, as ChicagoLooper suggested above. And this was done at GE so that even I understood the first time, and opened it.


I also hope that there is a faster and easier way.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes

АлексЮстасу
Advisor
Advisor

You can try converting your points file into two files - mif/mid.

Using Excel and a text editor is quite simple.
These are text files: mif - table description and geometry, mid - table contents, characteristics.
And MAPIMPORT immediately with the conversion of coordinates, with the loading of characteristics in Object Data, into the attributes of the desired block:

MAPIMPORT.png

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes

Murph_Map
Mentor
Mentor

Here is something from years ago. https://map3d.wordpress.com/2008/01/02/bring-a-csv-file-into-map-3d-with-data/

 

Murph
Supporting the troops daily.
0 Likes

Murph_Map
Mentor
Mentor

Another option is using the Map Task Pane and set up a survey data store. Then import ASSCI file. 

CVSImport.png

 

Murph
Supporting the troops daily.
0 Likes

АлексЮстасу
Advisor
Advisor

Alas, Task Pane, Import ASCII Points in sdf is similar to MAPIMPORT csv, txt in dwg in that you can import a maximum of two characteristics: Number and Description. I see the problem only in this.
I don’t understand why Autodesk didn’t let download any number of characteristics? It would be completely easy for Autodesk programmers to do this by adding in Import.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

jeguizaASRZM
Enthusiast
Enthusiast

Hello @Murph_Map 

 

This exact link is something I have been trying to duplicate. But I had had no success with this.

Would You be able to see if this can be done with the excel sheet provided?

 

Thank You For Your Time,

0 Likes

Pointdump
Mentor
Mentor
Accepted solution

Jonatan,
I can't see any easy way to do what you want in Map 3D. In the free QGIS you can import that CSV and export it as a Shapefile in about 30 seconds. QGIS will even allow you to export your Shapefile in UTM83-16F. With a Shapefile you can Query and Label those points easily.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

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

ChicagoLooper
Mentor
Mentor
Accepted solution

This is not a comprehensive exercise that covers the details and nuances of performing a query. This is merely the down-n-dirty way. Of course there are other, more elegant ways that use sophisticated workflows and achieve a narrower focus. This post, however, serves to demonstrate some of the basic options available using your specific csv file.

 

Given the the rudimentary composition of your csv and the absence of a specific goal you would like to achieve, no ODBC connection was used in this workflow. Since Map 3D's query parameters provide enough horsepower to query your lake points, other add-ons to the drawing would only constitute extra baggage and provide only fluff without any meaningful utility beyond Kardashsian-esque glamour.

 

You can do it. Warning: Combining this workflow with other instructions may (and I don't care where they came from or who uttered them), or may not, derail this entire workflow. Use caution when deviating from the prescribed steps. Here's the down-n-dirty that you can use to do the deed:

 

Format your csv like this. Do it now. Notice the column headings are preceded with '#.' It's critical to insert it before each heading because if not used, M3D will be confused and treat the headings as data when they're not. You may also delete the first row altogether and avoid any potential confusion the headings may cause. Your csv will need exactly 5 columns. Column E, the 5th column, contains 7 columns from your original csv. The 7 columns have been combined in excel using an excel formula. The formula was then copied and applied to all rows to efficiently generate the results. Implementation of the formula will not be covered in this exercise since you can do that on your own. Save this newly reformatted csv and close it. In the next step, you'll use MAPIMPORT command. The command won't work if your csv is open.

 

 

1-Format you csv like this (5-columns, A thru E))1-Format you csv like this (5-columns, A thru E))

 

 

Use MAPIMPORT command (Insert tab=>Import panel=>Map Import icon). Browse to your csv and choose PENZD (comma delimited) from the dropdown. You are specifically choosing PENZD because that's how you formatted your csv. 

 

2-Mapimport-choose PENZD comma delimited.2-Mapimport-choose PENZD comma delimited.

 

 

Make the import settings exactly like shown. When done, click OK to import your points.

 

 

3-Make settings for MAPIMPORT like this.3-Make settings for MAPIMPORT like this.

 

 

Zoom extents to see your points. Your points will likely overlap because the block, Map_Survey_Point, will be too big. You'll need to rescale the blocks. Select all the points and rescale in the Prop Palette. Use the same number for scale-x, -y and -z. The scale should be smaller, e.g. 2000, than what's shown in the Prop Palette for the overlap to go away.

 

4-Change scale so blocks don't overlap.4-Change scale so blocks don't overlap.

 

 

Because you've assigned UTM83-16F to modelspace and have indicated LL84-WGS84 was the CS used in the csv, your points will transform from lat/long degrees to UTM zone 16 feet. Turn on Bing aerial imagery to view the points with an aerial photo basemap. Since you stated in Post 3 of this thread that your are identifying Lake Coordinates, then yes, they're all wet because they're in the Lake! Haha! Save this dwg. Give it the name SETUP.dwg then close it. In the next step, you'll perform the query and the query can't happen if SETUP.dwg open.

 

5-Results of the query. Your blocks are in Lake Michigan.5-Results of the query. Your blocks are in Lake Michigan.

 

 

Go to The Task Pane=>Map Explorer Tab=>Right click Drawings=>Attach=>Browse to SETUP=>Select SETUP=>Add=>OK. SETUP will now be displayed int the drawing tree under Drawings like shown below.

 

6-Attach SETUP.dwg using MapExplorer Tab.6-Attach SETUP.dwg using MapExplorer Tab.

 

 

You will now begin building your query. (You can use your imagination to build your query, I’m obviously building an oversimplified one.) Still on Map Explorer tab, right click Current Query=>Define. Next, Location=>All=>OK

 

 

7-Begin building query. Location=ALL.7-Begin building query. Location=ALL.

 

Continuing with the build, Click Data=>Attribute=>Map_Survey_Point=>Operator ‘=’ sign=>Then manually enter ‘*red*’ (without the quotes & include asteriks)=>OK. Then Execute Query to view results.

 

8-Data=>Attribute=>Map Survey Point=>Attribute Tag=>Operator=>Value.8-Data=>Attribute=>Map Survey Point=>Attribute Tag=>Operator=>Value.

 

 

Up to this point, your query will consider all objects (I say all but really mean most because M3D will not really consider all objects, there are exceptions where objects are not considered, i.e. Civil 3D objects are not recognized in this type of query) in modelspace and evaluate whether red appears under the attribute DESC in any of the Map Survey Blocks. If red is not in the DESC attribute, then that block will be ignored. BTW, the * is a wildcard and is used to match red to any part of the DESC string.

 

When you build your query, you may get a pop-up message asking whether you want to save changes back to SETUP.dwg. Do not save back! You want to keep SETUP in its original condition. Decline any offers to save back because if you do, you’ll overwrite and essentially end up replacing the file.

 

You have successfully isolated all instances where the word red has appeared in the attribute DESC. If you wish, you may select the results of the red query and put them on a dedicated layer name RED.

 

You could have also chosen a different attribute or a different attribute value. You could have also used an operator other than the ‘=’ sign. You could have also queried Object Data as opposed to a block Attribute. As you can see, the permutations are mind boggling.

 

If you have put the result on a dedicated layer named RED, freeze that layer.Continuing with building a query, delete all lines below ‘Locations: ALL.’

 

In this next example, you will query all rows that satisfy three conditions: 1) Green, 2) Left and 3) Heavy. From Define Query dialog. There are exactly 7 points, that satisfy all 3 conditions, they are Points No's 16 through 22, see the orange highlighted rows.

 

9-Orange highlights are the 7 points your query will target. will9-Orange highlights are the 7 points your query will target. will

 

 

Define the query, it should look like this.

 

10-Your query will consists of 3 conditions as shown above.10-Your query will consists of 3 conditions as shown above.

 

 

When you execute the query, the results will look like this. The 7 points are shown with Bing aerial as a basemap. Points where the 3 conditions are NOT met are ignored and are not included in the 'Results.'

 

11-Results of query satisfying the 3 conditions. Bing basemap with the 7 queried points.11-Results of query satisfying the 3 conditions. Bing basemap with the 7 queried points.

 

This concludes the Down-N-Dirty way. For a more elegant way, describe in detail, what you are trying to achieve then repost with a new Subject Line.

 

 

 

 

 

 

 

 

 

 

Chicagolooper

EESignature

jeguizaASRZM
Enthusiast
Enthusiast

Wow!!! Thanks for the great explanation!! 

 

Lots of clarification!! The procedure really helped me recreate the steps!

 

I am very happy for the explanation and the willingness to help!!

 

I would have never in a million years guessed to combined my information into the "DESC" column!

 

Very Grateful!! @ChicagoLooper,

Thank You So Much For Your Time And Patience!!

 

Best,

JE

 

 

0 Likes

jeguizaASRZM
Enthusiast
Enthusiast

Awesome!!

This is also very helpful! 

@Pointdump 

This also satisfied the request!

My first target was finding if AutoCAD MAP 3D can handle the task, but this opened up a new window for me.

The most interesting task was that QGIS allows me to export my points as a Shapefile!

Thank You For the Reply!

 

Best JE

0 Likes

Type a product name