Extract multiple point coords
Extract multiple point coords
(OP)
I've got a 2D aerofoil section, consisting entirely of points from a CMM. The data I got from the CMM is not a single file, but several, and the coords in them 'overlap', in that the CMM went over certain sections of the aerofoil twice.
Now, using a script I've combined all these XYZ files together and drawn them as points on the screen.
I want to do two things: One is draw a polyline through all these points. I could do this by hand, but there are 500 or so points, and after this one I've got another 10 sections to go. Clicking 5000 points is something I'd rather skip.
The other thing I need to do is create a new file of all the XYZ points, IN ORDER. In other words, list all the coords of all the points in sequence around the profile of my aerofoil.
I can define the order of the points by creating a polyline through all the points, and then extracting the coords of the polyline....but I haven't got a polyline.
So, to the point. How can I quickily create a polyline thorough loads and loads of points, and how can I extract the XYZ data of a polyline to a text file?
Now, using a script I've combined all these XYZ files together and drawn them as points on the screen.
I want to do two things: One is draw a polyline through all these points. I could do this by hand, but there are 500 or so points, and after this one I've got another 10 sections to go. Clicking 5000 points is something I'd rather skip.
The other thing I need to do is create a new file of all the XYZ points, IN ORDER. In other words, list all the coords of all the points in sequence around the profile of my aerofoil.
I can define the order of the points by creating a polyline through all the points, and then extracting the coords of the polyline....but I haven't got a polyline.
So, to the point. How can I quickily create a polyline thorough loads and loads of points, and how can I extract the XYZ data of a polyline to a text file?





RE: Extract multiple point coords
or are you wanting to do a grid of sorts
if everyone helps everybody the world will be a better place
RE: Extract multiple point coords
1. Why do you want to draw a polyline, maybe a 3dmesh or 3d faces would be more in order if you want to create a viewable image.
2. You have all the points, but what is "in order". Is there some mathematical way to define the order? If so maybe you can manipulate the points in a spreadsheet, then again create a script like you did before to draw a polyline through the points.
And yes there are ways to extract points from polylines from their entity data, using lisp commands like ENTGET and ENTNEXT.
RE: Extract multiple point coords
;Makes a 3D Polyline through the following points.
;Assuming the coordinates are available in ascii file,
;Just put the Acad command on top
;
;
_3dpoly
10,10,0
10,20,0
20,20,0
20,30,0
30,30,0
40,40,0
;----Notice the extra line on bottom for ENTER
;
;Hope this is a useful first step
;
;On request, I can supply the following too:
;DWG <To/From> EXCEL
;Like, coords from drawing into Excel
;3D objects into DWG from data in Excel, etc
;www.homescript.com
;www.freehomepages.com/tigrek
;tigrek@hotpop.com
;
RE: Extract multiple point coords
Anyway, I'm working in 2D with AcadLT first off, so LISP is a no-no.
Also the aerofoil is a section in 2D.
Hmm, lets try an analogy.
Imagine I've got a load of random XYZ coords in a text file that I know fall on the outline of a circle (or an aerofoil). I don't know where on the outline they fall and for some reason I can't visualise it from the numbers. (I know I could for a circle really, but it's harder for an aerofoil..stick with me..)
So, I create a script file which will draw all the points on the screen. I now have a circle of points.
Now, I want to draw a pline through all these points to create a pline circle, (just the circumfernce) but I've got an awful lot of points and it would be mind numbingly time consuming to pick each one in turn. Is there an easy and quick way to draw the pline?
Secondly, I need to create another text file with all the XYZ points in, but this time the points have to be ordered.
In other words, starting at 12o'clock, and then listing each point in a clockwise direction in turn around the circle until I get back to the start, rather then just the random points on the circle. So point 1 in the txt file will be the point thats at 12oclock, point 2 will be the point at 12.01oclock and so on.
I've got an idea to do this by turning on acads LOG file, then LISTing the polyline which will give me all the points from 0 to 360 degrees. Then I can just use my trusty text editor on the LOG file to just leave me the point coords.
It has to be done like this, btw, because although it's a pain now, it's a lot easier to handle the infomation when we get to the CAM/CNC stage of things....What we'll do use several of these sections on a projection drawing for inspection purposes when we get to production, and we will also use these sections to loft into a solid when we get to the CAM stage.
RE: Extract multiple point coords
Does this approach have potential?
Another way might be to use a "auto snapping" routine that as you traced a line it would snap to the nearest point, so that you would only have to drag cursor in an approximate path over points. Don't know if this is available or if it would be difficult to develop.
Just some suggestions, hope it gives you some ideas.
RE: Extract multiple point coords
The points are best arranged before plotting - in excel for example.
Then, into a text file, named something.scr
I know that Acad LT accept script files.
Then, as I said above, on top of each list of points,
_3DPOLY
and on bottom an empty line
same thing for each group of points to be connected.
The groups to be determined in Excel
with an excel macro as CarlB said.
RE: Extract multiple point coords
Anyway, since I posted the question I've blackmailed a handy computer tech to write me a perl program to automate the whole thing, (he'll probably code me out of a job now), so i'll see how he gets on, but when I've got a moment I'll have a play with Excel and see what I can come up with. I didn't realise you could do stuff like that with it!
Excellent, thankyou all very much!