Import specific LiDAR Classification code from .xyz file into Civil 3D?

Import specific LiDAR Classification code from .xyz file into Civil 3D?

Daniel_Hinks
Enthusiast Enthusiast
3,815 Views
24 Replies
Message 1 of 25

Import specific LiDAR Classification code from .xyz file into Civil 3D?

Daniel_Hinks
Enthusiast
Enthusiast

I currently have a large .xyz file i need to import into Civil 3D, however i actually only need the points with the code '20' listed next to the X,Y,Z columns (see imaged attached). There are many other types of points in the file with other codes up to 151 but as i say i only need the code 20... but i cannot bring the whole file in because it is too large.
If i can't do this via civil 3D... is there a alternate method i could use to filter out those points before hand perhaps? (I cannot use Recap).

Thanks.

0 Likes
3,816 Views
24 Replies
Replies (24)
Message 2 of 25

Pointdump
Consultant
Consultant

Daniel,
Good question. In Civil 3D you can use a Map Query, but you'd first need a drawing with all those points loaded. That might be kinda slow if your XYZ file is huge. Other options are to use a Filter in QGIS or >>>Excel<<<.
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
Message 3 of 25

ChicagoLooper
Mentor
Mentor

I believe there are issues with you workflow:

  1. LiDAR typically goes to Recap first, then into C3D in rcp format. You are treating LiDAR points as though they are cogo points. 
  2. XYZ’s are exactly three ‘columns’ of data which correspond to easting, northing and elevation. You are adding a 4th, and possibly more, column(s) so technically it’s no longer an XYZ. 

I understand you only want the Class  20 points but treating your points as cogo isn’t right. Please take a screenshot of your LiDAR file as it appears in its Windows folder so its original file extension can be seen. 

Chicagolooper

EESignature

0 Likes
Message 4 of 25

Daniel_Hinks
Enthusiast
Enthusiast

Hi Dave,

Thanks very much for your prompt response.

Yes... i tend to use Excel to filter these points for smaller files but this one is huge, nearly 2gb... as an alternative i can only use Notepad++ as an approved application for my business (I have used EM-Editor before which i prefer but i cannot use this at work)...

My eventual process was to use a 'Find all' -> Value = ,20 ... and then i can place a bookmark line against all of those. Then after that i can use a function which would copy all of the bookmarked rows to another file, and then hopefully i'd be able to import those points into Civil 3D. The issue i find with this, however, is my machine will crash at the point where it tries to copy all of the bookmarked lines to another file... close but no cigar!
I'll take a look at your other suggestion for Map Query or QGIS... thanks very much

0 Likes
Message 5 of 25

Pointdump
Consultant
Consultant

Daniel,
Wow, 2GB! Excel will choke on that, even if the data limit isn't reached. Your idea of Notepad++ is clever. I didn't think of that.
Can you post a small sample, maybe 10 or 20 lines? I'd like to test out QGIS, CloudCompare, and LasTools.
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
0 Likes
Message 6 of 25

Daniel_Hinks
Enthusiast
Enthusiast

Thanks for the suggestion ChicagoLooper,
I know the simple method would be to use Recap to manage LiDAR data. However i don't have access to this software in my business currently (apologies that's what i meant in my post when i said i cannot use recap, i should give myself a bit more credit haha i should have said i have no access to recap).

I'm a bit of a beginner using Civil 3D, as Revit is my primary software which i use but i've been trying to improve the way in which we collaborate in terms of sharing LiDAR data and ground surfaces particularly... 
I didn't realise xyz files were strictly for X,Y,Z data only, other none autodesk software i have used in the past had around 8 or more fields of data... RGB, Plan Comments, Profile Comments assigned to each point for example.
Anyways, see attached image of file types as you asked. Thanks.

 

 

0 Likes
Message 7 of 25

Daniel_Hinks
Enthusiast
Enthusiast

Thanks Dave,

See attached... 3kb is a bit more manageable than 1.7million 🤣

0 Likes
Message 8 of 25

ChicagoLooper
Mentor
Mentor

Yes, that file belongs in Recap. These are the extensions Recap can take:

 

1.jpg

Chicagolooper

EESignature

0 Likes
Message 9 of 25

Pointdump
Consultant
Consultant

@ChicagoLooper,
I haven't had much luck with anything but LAS/LAZ in ReCap:
https://forums.autodesk.com/t5/recap-forum/using-a-penzd-point-file/td-p/10057816

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
0 Likes
Message 10 of 25

Pointdump
Consultant
Consultant

Daniel,
Thanks for posting a sample. I'll try it in a few applications.

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
0 Likes
Message 11 of 25

ChicagoLooper
Mentor
Mentor

Yes, las and laz are better, especially when you have classified points.

 

XYZ is the bare minimum, no bells and whistles. It's like the getting a doc in Notpad when you really want it to be in  in Microsoft Word.

Chicagolooper

EESignature

0 Likes
Message 12 of 25

Pointdump
Consultant
Consultant

Daniel,
QGIS works good to select all the points with "20" and then use Export to...

 

Query_1.png

 


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
0 Likes
Message 13 of 25

Pointdump
Consultant
Consultant

Daniel,
This is fun!
CloudCompare is another good option. It's very fast. You can filter points with 'Edit > Scalar fields > Filter by value':

 

Query_2.png

 


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
0 Likes
Message 14 of 25

Pointdump
Consultant
Consultant

Daniel,
I didn't have any luck with a Map Query. I think it can be done, but I just don't know how.

 

Query_3.png

 


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
0 Likes
Message 15 of 25

ChicagoLooper
Mentor
Mentor

This procedure requires 3 steps if you want to use AutoCad exclusively (no 3rd party needed). The sequence is MapImport=>MapExport=>MapImport. This might be clunky, that file is huuuge, but it'll work. (Test it on the Sample file that was uploaded earlier.)

 

  1. Use MAPIMPORT command and import the txt file. You'll get points. The points will be super large so to select all points and go to Properties Palette and change all scales (X, Y and Z) to something very small such as 10. See image-1.
  2. Use MAPEXPORT command and export all points to shapefile. Make settings for Selection  and Data as shown. No changes needed on Options tab. See image-2.
  3. Finally, use MAPIMPORT again. This time instead of importing the txt file, import the shapefile you created in step 2. Make settings like this. See image-3.

Image-1.Image-1.

 

Image-2Image-2

 

Image-3.Image-3.

 

 

 

Open the Properties Palette and view the Layers. They should look like this. See image-4.

 

Image-4.Image-4.

 

If all 3 steps are completed correctly, the points can be controlled on a ByLayer basis.  

Chicagolooper

EESignature

0 Likes
Message 16 of 25

Pointdump
Consultant
Consultant

@ChicagoLooper,
But how do you filter the points so that only "20" Points are left in the drawing? Or save an XYZ file of only "20" Points?

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
0 Likes
Message 17 of 25

ChicagoLooper
Mentor
Mentor

I didn't run a query, didnt think it was necessary.

 

The KEY to this method is USE DATA FIELD FOR LAYER NAME.  Typically, all imported layers  end up on the same layer when using the MapImport command. In this situation,however, the data is used to 'separate ' the points to their own layer.

 

 

6.jpg

 

 

 

Then to filter the points refer to Properties Palette.. I could delete all points NOT on Layer '20.'  Otherwise, copy the points on Layer 20 layer and paste to a new drawing=>Then SAVE the dwg.

 

5.jpg

 

If i wanted to run a QUERY, I'd do it like this........

 

7.jpg

 

 

...........and the result would be this.

 

8.jpg

Chicagolooper

EESignature

0 Likes
Message 18 of 25

jae.kwon
Collaborator
Collaborator

- It can be done in Civil 3D using a Map 3D command but it is VERY slow and I don't recommend it

- Recap can't do it

- I highly recommend LASZIP for filtering any point cloud source files. It has both GUI and command line options. 

0 Likes
Message 19 of 25

Pointdump
Consultant
Consultant

Jae,
Looking at LASZip ReadMe just now and I see:
Filter points based on their user data.
-keep_user_data 1
Is that what you had in mind? That might work. I like the LASTools. They're very fast.
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
0 Likes
Message 20 of 25

Pointdump
Consultant
Consultant

Jae,
I'm not having any luck with either LASZip or LAS2LAS. I'm calling Field 4 a "user" field, but LASTools doesn't seem to recognize "20", so it returns "0 surviving points".

 

las2las -cpu64 -v -i "D:\Download\Sample.txt" -iparse xyzu -keep_user_data 20 -odir "D:\Download" -odix "-Filter" -otxt
reading 0 and writing all surviving points ...
total time: 0 sec. written 0 surviving points to 'D:\Download\Sample-Filter.txt'.
removing empty output file 'D:\Download\Sample-Filter.txt'

 

Have you tried it? Did it work for you? LASTools is maddeningly difficult to understand.
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
0 Likes