select 3d points by polylines

select 3d points by polylines

balazscsaby
Explorer Explorer
2,230 Views
19 Replies
Message 1 of 20

select 3d points by polylines

balazscsaby
Explorer
Explorer

Hello.

Is there any way of selecting all 3d points thru which passes a polyline? I have a big point file (95000+ points) from a point cloud, and I have draw the polylines of interest. I need to export the points to a .csv file (x,y,z), but only those points thru which passes my polylines.

0 Likes
Accepted solutions (1)
2,231 Views
19 Replies
Replies (19)
Message 2 of 20

Anonymous
Not applicable
hi balazscsaby,
 
 
 
 

 i also use points from pointclouds and i make some procedure about. if you explain better the job you want make with your points maybe i have some procedure usefull for you. You write about point and about polylines but, maybe for my no goog english, i don't understand the relationschip about this two elements....

if is possible also send one sample.dwg adn explain wath you want obtain....

with pleasure i help you.

Best regards Giovanni

 

0 Likes
Message 3 of 20

balazscsaby
Explorer
Explorer

Hello.

Firstly i should mention that i am working on an article within my phd school - study case, about a new kind of procedure to make a site plan from drone measurements. I made my point cloud and my orthomosaic. I converted a filtered part of my point cloud (the density is about 10cm) to dwg so i could open it in autocad. I inserted my orthomosaic map in the background of my point cloud. This way i can draw all the elements from that region, each of them in separate layer( house, road ect). After that i would like to save just the points that are useful, in other words those which are essential for my polylines to go thru them. (The polylines that are passing the 3d points, I would like to quick select those 3d points and export them into a csv file). Best regards, Csabaex2.pngex1.png

0 Likes
Message 4 of 20

Anonymous
Not applicable

Please open my DWG, inside some question for you. 

about you are working on an article within your phd school - study case, about a new kind of procedure to make a site plan from drone measurements, no problem i am researcher and aggregate professor in drawing and relief in the university of florence (italy) architecture departement. so is interesting for me collaborate with you if you like.

Best regards Giovanni

 

0 Likes
Message 5 of 20

balazscsaby
Explorer
Explorer

I responded to your questions. Hopefully I made it clear for you which are my intentions there. I would be glad to collaborate with you, because my interest is to learn as much as possible from people who can give me knowledge. information's nowadays are pure gold. at least this is how I think about it. if it is possible we could continue some of our discussions privately, on LinkedIn, or via email. balazscsaby@yahoo.com

Thank you for your time, and for the fact that you are willing to help me.

With esteem and respect,

Csaba

0 Likes
Message 6 of 20

Anonymous
Not applicable

Hi Cisaba,

for better collaborate in one project like this sure is better before speach a little together; for this i write you at your email adress my contact.

I wach yoyr reply and i have some idea about solve with some routines this but is in function of your autolisp level so better before speack toghether. Unfortunately in my library not exist nothing read for., but is possible start from sometings i have sure.

Best regards Giovanni

0 Likes
Message 7 of 20

Anonymous
Not applicable

wach the DWG is about something is near at your job in this case imagine in Blue your hortomap in white some points select in automatic from one pointclouds and in red the pline obtained from the selection

0 Likes
Message 8 of 20

Anonymous
Not applicable

one other file.DWG with one sample (is not exacly one real sample...) about the pointclouds  i have in my job maybe usefull for investigate one possibile intersection about my job and your job....

0 Likes
Message 9 of 20

stevor
Collaborator
Collaborator

My translation of your;

"I have draw the polylines of interest."

is that your  'polylines' already exist.

And if not, making them automatically is a big deal.

When and if they exist, as LWPOLYLINEs or "*LINE"s,

then you can use (ssget "F" ... to find 'POINT's 

on the segments , or close enough; not difficult.

Many examples, start at lee-mac.com, to get

some ideas or solutions for you job, and to get

the spellings and terms close enough.

 

S
0 Likes
Message 10 of 20

balazscsaby
Explorer
Explorer

The polylines are drawn by the user (by myself). So I would like to select all the points in which my polyline passes, point by point. As you can see in the attached .dwg file, I have drawn my polylines, passing the points of interest. the problem is that I didn't find a solution to select those points easily, just manually, selecting point by point all those which are important from the perspective of the task.

0 Likes
Message 11 of 20

john.uhden
Mentor
Mentor

Just an observation... maybe you want to include points that are close (within some specified horizontal distance) to your polylines.  Are the points on separate layers, so that some may be ignored?  95,000 points just might be overtaxing for AutoCAD and/or your computer.  Then again, the fence method may be the best and easiest approach.

I am not familiar with point clouds, except that they were probably obtained using LIDAR.  Are the points similar to AutoCAD points where you can specify a point style and size?  That would be important for the fence method to work.

John F. Uhden

0 Likes
Message 12 of 20

balazscsaby
Explorer
Explorer

All the points are in the same layer. They are the same as AutoCAD points, they have defined geometry. For the moment I didn't get a method step by step where I could select the points that I want to, or to select those points which are near my polyline, I have tried lots of explanations, but they didn't work out for me. if your have an idea step by step what to do to select the points near my polylines I'm interested in it, because if I can specify the range distance within the point's should be, that should resolve my problems, and my lack of knowledge too.

Best regards, and thanks for your help,

Csaba

P.S.> I didn't manage to download the ssget lisp, although I read about that method on lee-mac.com as specified in the post above.

0 Likes
Message 13 of 20

john.uhden
Mentor
Mentor
The pseudo code is simply to select a polyline (no bulges I hope),
extract the vertex points and send them to the select-by-fence method.
Before that, change the point style and size to determine the fuzz factor
of which points are close enough to be selected. Then extract the
coordinates of each point selected and write them out to a comma-delimited
.CSV file.
Now bear in mind that the selected points will create an alignment
different from your polyline because they won't be exactly on any segment
of your simplistic polyline. But if you want that, then we could add a
little code to adjust their location to be exactly on the polyline before
we write out the coordinates.
You should also think of naming each path, maybe with the layer name of the
selected polyline, so that the file would look like...
E-BUILDING
x,y,z
x,y,z
etc.
That way you could actually select multiple polylines and have all the data
written to one file in one shot.

John F. Uhden

0 Likes
Message 14 of 20

Sea-Haven
Mentor
Mentor

I think to much discussion could have been answered at about post 2. If you make a surface of points cloud then lines can be draped on the surface and cnr point Z found very quick and normally accurate enough as you are using a point cloud z's. Doubtful that 10cm intervals would be used on land type development the clouds would just blow apart in size, a value around 500mm would be a min.

 

Basic civil engineering task built in to CIV3D or others.

0 Likes
Message 15 of 20

balazscsaby
Explorer
Explorer

Dear sea.haven,

I have tried making a surface out of the pointcloud ant to make a 3dpolyline on it and grab the z values, but with no good results. Although thanks for your idea / approach. if you think that this is working and i didn't made something in the right way on what you have written, please make a step by step print screen about how should this work. because i don't know.

B. regards,

Csaba

0 Likes
Message 16 of 20

john.uhden
Mentor
Mentor
Don't you need C3D to do the draping? Did he indicate if he is using C3D?
I am also wondering why he wants the points in a spread sheet. Why not
just create 3DPolys? It's not very difficult to program.

John F. Uhden

0 Likes
Message 17 of 20

Anonymous
Not applicable
Accepted solution

For Csaba, please try this code down maybe after our calling on skype this is wath you need.

For all: sorry, after finish to writing this message i read also all your messages; yesterday i speak with Csaba on skype and find some solutions with him for him, down the code:

;------------------------------------------------------------------------------------------------------------------------------
(vl-load-com)
;------------------------------------------------------------------------------------------------------------------------------
(defun CMD-0 () (setq *cm_old* (getvar "cmdecho")) (setvar "cmdecho" 0))
(defun OSM-0 () (setq *os_old* (getvar "osmode" )) (setvar "osmode" 0))
(defun CMD-P () (setvar "cmdecho" *cm_old*))
(defun OSM-P () (setvar "osmode" *os_old*))
;--------------------------------------------------------------------------------------------------------------------------------------------------------
(defun Draw_Pu (Pu1) (CMD-0) (OSM-0) (vl-cmdf "._point" Pu1) (CMD-P) (OSM-P) (entlast))
;------------------------------------------------------------------------------------------------------------------------------
(defun LNEW (lay col) (VL-CMDF "Layer" "n" lay "c" col lay ""))
(defun LSET (lay) (setq *lay_old* (getvar "clayer"))(setvar "clayer" lay))
(defun LSETP () (setvar "clayer" *lay_old*))
(defun LCUR () (getvar "clayer"))
;------------------------------------------------------------------------------------------------------------------------------
(defun get_vval (ent §prop) (vlax-get-property (vlax-ename->vla-object ent) (read §prop)))
(defun get_vlis (ent §prop) (vlax-safearray->list (vlax-variant-value (get_vval ent §prop))))
;------------------------------------------------------------------------------------------------------------------------------
(defun P_lay_not_curr (lay) (not (equal (getvar "clayer") lay)))
(defun P_lay_not_exist (lay) (not (tblsearch "layer" lay)))
(defun P_WCS (ucs_vers) (equal ucs_vers '(0.0 0.0 1.0)))
;------------------------------------------------------------------------------------------------------------------------------
(defun Draw_extract_PT (ent / tipo_ent vent cont elev_vent vers_vent PT)
(setq tipo_ent (cdr (assoc 0 (entget ent)))
cont 1)
(cond ( (equal tipo_ent "LWPOLYLINE") (setq elev_vent (get_vval ent "Elevation")
vers_vent (get_vlis ent "Normal" ))
(foreach val (get_vlis ent "Coordinates")
(cond ((= cont 1) (setq PT (list val) cont 2))
((= cont 2) (setq PT (append PT (list val elev_vent)) cont 1)
(Draw_Pu (if (P_WCS vers_vent) PT (trans PT vers_vent 0)))))))
( (equal tipo_ent "POLYLINE") (foreach val (get_vlis ent "Coordinates")
(cond ((= cont 1) (setq PT (list val) cont 2))
((= cont 2) (setq PT (append PT (list val)) cont 3))
((= cont 3) (setq PT (append PT (list val)) cont 1)
(Draw_Pu PT)))))
( (equal tipo_ent "LINE" ) (Draw_Pu (get_vlis ent "StartPoint"))
(Draw_Pu (get_vlis ent "EndPoint")))))
;------------------------------------------------------------------------------------------------------------------------------
(defun c:makePT ( / cont name_ent0 tipo_ent0 lay_ent0 lay_PT col_PT ssx_entn)
(setq name_ent0 (car (entsel))
tipo_ent0 (cdr (assoc 0 (entget name_ent0)))
lay_ent0 (cdr (assoc 8 (entget name_ent0)))
lay_PT (strcat lay_ent0 "-PT")
col_PT (cdr (assoc 62 (tblsearch "layer" lay_ent0)))
ssx_entn (ssget "x" (list (cons 0 tipo_ent0)(cons 8 lay_ent0))))
(if (P_lay_not_exist lay_PT) (LNEW lay_PT col_PT) )
(if (P_lay_not_curr lay_PT) (LSET lay_PT) )
(setq cont 0)
(repeat (sslength ssx_entn)
(Draw_extract_PT (ssname ssx_entn cont))
(setq cont (1+ cont)))
(LSETP))
;------------------------------------------------------------------------------------------------------------------------------
(defun c:purgePT ( / cont lay_PT ssx_entn)
(setq lay_PT (strcat (cdr (assoc 8 (entget (car (entsel))))) "-PT")
ssx_entn (ssget "x" (list (cons 0 "POINT")(cons 8 lay_PT))))
(setq cont 0)
(repeat (sslength ssx_entn)
(vl-cmdf "._erase" (ssname ssx_entn cont) "")
(setq cont (1+ cont))))
;------------------------------------------------------------------------------------------------------------------------------

 

 

0 Likes
Message 18 of 20

Anonymous
Not applicable

Hi Csaba, if you like is possible one second meetin for speack about the first pat of the job, i have some procedure for automatic draw pline from point clouds, yesterday dont speack about, bt maybe this is one other useful change in your perspective about your job.... 

best regards Giovanni

0 Likes
Message 19 of 20

Anonymous
Not applicable

select also all points near your polilines from point clouds, considering one little distance (your choose the little distance) is possible. if you like is possible make one second meeting online and i show sometings about my job about.

also is possible make polilines in automatic after select this points and also il spossible seplyfy this poliline using some algoritm also i have.

best regards Giovanni 

0 Likes
Message 20 of 20

Sea-Haven
Mentor
Mentor

This is a school project so I am starting to think not really sure what is required if you read 1st post again talks about a couple of things like wants at the points near the line say v's just converting a 2d line to a 3d line. 

 

2d to 3d what method ? Use triangles and get 3d Z value use a few pts say 1-4 average for Z or some form of weighted average. A simple parallel box _CP for the points nearby is easy as you have mentioned.

 

Re mesh there are free lisps out there to do TIN's and do a profile along a line. Don't need Civ3D problem solved.

 

Re clouds I have a 283 mb your welcome to play with.

0 Likes