Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CSV file type longitude and latitude coordinates into AutoCAD LT

35 REPLIES 35
SOLVED
Reply
Message 1 of 36
Craig.Boruch
3798 Views, 35 Replies

CSV file type longitude and latitude coordinates into AutoCAD LT

Would I be able to import a .csv file of longitude and latitude coordinate points into AutoCAD LT 2018? 

35 REPLIES 35
Message 21 of 36
Craig.Boruch
in reply to: steven-g

I don't know.  I guess when you are working across different platforms there will always be discrepancies.  Gonna have to do some testing.  I'll keep you posted.

Message 22 of 36
Craig.Boruch
in reply to: steven-g

I don't know for sure.  I've used different systems in my work before even though AC recommends using the closest system to your location, but never noticed any change when I did.  I'm speaking with a Surveyor now to get some accuracy with this and he is saying the different programs are calibrated differently which will lead to discrepancies.  For GPS, GIS and all the mapping programs you'd think they'd do something to boost accuracy and then all agree on it. 

Message 23 of 36
steven-g
in reply to: Craig.Boruch

Yeah, you would think with 64-bit computing, that all these different versions of the shape of the world could actually produce a consistent model, please keep us up to date this is a fascinating subject, who knows one day it might become accurate???

Message 24 of 36
Craig.Boruch
in reply to: steven-g

Hi Stephen,  I know it's been a while, but I wanted to let you know that this "geomarklatlong" command is working well.  Accuracy gets better with more decimals in the lat/long so there are some down sides to that.  I went back to look at your first replay to this post of using "POINT &A1&,&B1&" to use in excel and though I could try typing that command as how Excel would put it out (POINT 41.696934,-81.822622).  However, if I space after POINT it immediately ask to specify a point.  So I can't do a space.  Then if I type the coordinate without a space it will put a point, but it's according to the x/y of the model .dwg and not according to the geomap that I had inserted.  I've just been told I will be getting a job with a few hundred points and will not be able to "geomarklatlong" the whole thing.  I'm not finding anything that may help me with this.  Would you have any advice?  Something just popped into my mind.  Maybe an Excel formula using the geomarklatlong command????

Message 25 of 36
steven-g
in reply to: Craig.Boruch

Hi Craig,

It's good to hear it is working when I gave the first answer I wasn't fully aware of the "geo" options available to LT so that post wouldn't work with the information you have, and to be honest, this is something I have never used myself, but looking through the help files it certainly looks as though either the 'geomarklatlong' or 'geomarkpoint' should do what you need, reading back it looks like you managed to figure out how the data relates to the correct location. So I would think that once you have the 'geographiclocation' set correctly then adding points would use one of the other two commands and you should be able to create an excel formula that uses the command name (eg "=geomarklatlong " & A1 & "," & B1) just watch the placing of the quotes as that makes the formula work (or not), and this would only work after you have the geolocation active.

Try it and if you get stuck post a dwg with the geolocation correctly working and your csv file.

Good luck and thanks for keeping us updated.

Message 26 of 36
Craig.Boruch
in reply to: steven-g

Hi,

Here is the formula I am using; ="geomarklatlong " & A1 & " " & B1&" 1"

Fortunately, the space in the quotes told AC LT to *ENTER* and it worked when I cut and pasted into the command line.  However, it only did one line since it wanted some text to annotate the first point.  I added the space and " 1" at the end in the Excel file with the hopes that when I copy it down it would automatically change it to 1,2,3,4..etc.  It just copied the 1 all the way down.  It did work for the whole sheet of data, but every point is annotated with a "1".  Is there a piece of formula that can put the number at the end and have it correspond with the row number in Excel?

Message 27 of 36
steven-g
in reply to: Craig.Boruch

Can you post the dwg and the csv? However there is no space in the quotes there should be a comma between the quotes which is used to separate the two sets of x y coordinates.

Message 28 of 36
Craig.Boruch
in reply to: steven-g

Hi, I don't have the csv yet.  I'm doing everything as a test so the coordinates and drawings are all randomly picked and created by me.  Yes, the comma separates the coordinates, but AC LT doesn't recognize the comma as a valid latitude and longitude.  It says, "Invalid Input".  So like I said before, the space tells AS LT to *enter* to the next part of the geomarklatlong command.   I found a new command to use in the Excel formula that will allow me to add everything I need to let AC LT use it. 

=CONCATENATE("geomarklatlong " & A1 & " " & B1&" "&ROW(A1) )

So once Excel created the data I need from the lat/long I will copy and paste it into a notepad, save it as a .scr file format and then I have to use the "script" command in AC LT to get it to work.  We'll see what happens when I actually get the few hundred lines of coordinates, but it works for me with my test data and file that I drew up.

Message 29 of 36
steven-g
in reply to: Craig.Boruch

OK that sounds reasonable yes geomarklatlong might work differently than with the point command and not use a comma, but I don't have the benefit of any test data to try it out here, if you run the geomarklatlong command manually at the command line what is the sequence of keys you need to press in order for the command to work? 

OK did some testing it looks like it won't work directly pasting from excel to the command line but, paste the code into a script and run the script works fine. Here is the script example

geomarklatlong 51.2 4.4 point one
geomarklatlong 51.21 4.41 point two

it requires a space after the keyword 'geomarklatlong' and a space after the latitude and longitude coordinates, anything after that is considered a text label for the point, and a new line ends the command. So in excel, the formula would read ="geomarklatlong " & A1 & " " & B1 & " " & C1

were A1 has the latitude, B1 the longitude and C1 has the text for the label.

From excel you can copy all the formulas and paste the results into notepad then save the file with an .scr file extension. You can then just drag the script file from windows explorer directly onto your open autocad drawing (with the geolocation active) and the script will run.

Message 30 of 36
Craig.Boruch
in reply to: steven-g

A slightly different approach, but yes.

Message 31 of 36
steven-g
in reply to: Craig.Boruch

Yeah slightly different, sometimes you need a different approach, running it directly from Excel (copy-paste) the label part of geomarklatlong won't exit from the text input at least not simply, it looks as though it needs that 'hard' newline that a script gives to the code. So it does require a few extra steps, but it still beats doing everything by hand and having to type in all those coordinates one at a time 😁.

Message 32 of 36
kellyG5PQG
in reply to: steven-g

Hi @steven-g  

 

This solution helped me IMMENSELY, thank you so much!  I am wondering if you could assist with a related problem.  I used your script to populate fifty coordinates into my drawing, but when the points populate they are very small and illegible at the scale that I need them to be.  Instead of resizing each point individually (so that it retains the correct coordinates), do you know of a way to either batch-resize them (while still maintaining their center position), or a way to change the default geolocation point size so that when the script loads, the points and text are much larger?  I already tried the PTYPE command but that did not work.


Thank you for any help you can provide!

Message 33 of 36
d.makuce
in reply to: Craig.Boruch

For practical purposes, one minute of latitude is one nautical mile in distance or approx. 6076.115 feet.  You can calculate what the distance of one minute of longitude in feet is at a given point by the formula [6076.115 x cosine (degrees latitude of that point)].  In AutoCad Lt, I suggest you use a local reference point (long/latitude) to avoid extremely large numbers of feet.  In a spread sheet you can set up formulas to do this and get values in feet for use.

Message 34 of 36
torbenLTA2R
in reply to: Craig.Boruch

Hey.

Is it still the same way, here in 2023 (Autcad LT 2023)  ?

 

Message 35 of 36
pendean
in reply to: torbenLTA2R
Message 36 of 36
Craig.Boruch
in reply to: torbenLTA2R

@torbenLTA2R ,

I would have to believe it would work the same.  I have since upgraded to AutoCAD full version, had ArcGIS for AutoCAD plug-in and Map3D installed.  I would suggest giving it a try and letting us know how it goes. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost