←  Technical Questions

nanoCAD forum

»

Import Points from csv

Canada's Photo Canada 20 Sep 2012

Hi.


Can anybody help me to import points from a csv file. I do land surveying and I'd really like this feature. I don't know how to write scripts or code...

But maybe it's easy to write this script.

Here's an example of the way the csv file looks:

1,5215216.637,405694.177,728.005,PLREBAR

Which is:
point number, northing, easting, elevation, code(description)

which is standard format for points collected when surveying. The northings and eastings could be decimal degrees instead, too, doesn't matter, but the 2nd, 3rd, and 4th fields are the coordinates anyways. I'm only interested in 2 dimensions, so I don't need the elevation data, although the last field (description) would be really good to import along with the point.
Quote

Plato's Photo Plato 25 Dec 2012

Just some thoughts. I have tried this with an airfoil but not survey coordinates. You may not see what you want if you try this.

Presumably the point number and code description are a unique pair that could be the ID of the point. The remaining three items are then lat, long, elev with respect to lat-long = 0,0. From a scaling perspective, there would need to be a significant offset from the zero of the 3D axis to reach the surveyed area and that needs to be scaled to reflect meaningful data on the display. ie in x,y,z = 5215216.637,405694.177,728.005 the offset might be -5215216,-405694,-700 leaving 0.637,0.177,28.005 which can then be more realistically scaled.

Notwithstanding the need to display the ID label, you can create a script file in Windows Notepad starting as follows. You may want to scale the elevation. Just keep adding points to the list e.g.


POINT
M
0.637,0.177,28.005

Then when the list is done, save this as ALL Files with the extension .scr (if you want to locate it again in the folder you may need to click All Files)

You can then run the script in DraftSight under Tools and save this as a .dwg file that can then be imported to Nanocad. You may need to play around with the scaling before you see the point as it could be either off screen or close to the axes zero unfortunately.

Maybe when you get this part working then the labeling issue can be addressed. :ph34r:/>






I used Dassault Systemes DraftSight as it can run scripts.
Quote

Ronny Schneider's Photo Ronny Schneider 06 Apr 2016

That is highly disappointing that a basic csv import is not possible!! So far I've seen that in every CAD program in one way or the other. But not at all? We really have to start programming our own dll's for that?

Does anyone have already a compiled dll or vbs script?

Thanks in advance
Quote

Hellen_V's Photo Hellen_V 11 Apr 2016

Hello Ronny,
this option exists in vertical applications, not in Platform.
Contact Developers' Club: http://developer.nanocad.com/
Quote

Radim's Photo Radim 18 Oct 2023

Hello everyone and sorry for reviving an old thread, but even 7 years later this is the first result that google comes up with when typing `nanocad csv import`...

So I have tried both methods as described in ISL's links, installing Visual studio and downloading the source files from an ftp. Both projects gave me around 12 errors when building and I am unable to fix them as a non-coder.


Is there any chance someone could guide me through fixing these issues? Or, even better, put a compiled dll for download for a fee? I would be happy to pay for this as all I need is to merge a csv file with a dwg file and import the result into Revit to create a toposolid...

Many thanks for any feedback and have a great day
Quote

Artemio's Photo Artemio 23 Oct 2023

And as it was 7 years ago, one of the possible solutions is to search for it in:

Personal cabinet of nanoCAD Developer
Quote

MСAD's Photo MСAD 16 Nov 2023

View PostRonny Schneider, on 06 April 2016 - 03:10 AM, said:

That is highly disappointing that a basic csv import is not possible!!
You can import csv into a table and insert any blocks.
Quote