Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract multiple point coords 4

Status
Not open for further replies.

knobhead

Aerospace
Mar 6, 2001
184
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?
 
Replies continue below

Recommended for you

so basically using plines you want to create a erane of this 2D aerofoil am i right so if say in a 10' square you have say 100 points are you wanting to draw a pline point to point creating a mess of pline triangles

or are you wanting to do a grid of sorts if everyone helps everybody the world will be a better place
 
Your description of the problem begets more questions.

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.
 
;3DPoly.scr
;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
;;;tigrek@hotpop.com
;
 
Thanks for all the replies, but maybe I havn't explained it too well... (I tried!) It's one of those things I could explain in 2 seconds with a drawing..
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.
 
Are the points are spaced closely enough, such that a point nearest any point is how the line should be drawn? If so, then a lisp routine (or Excel macro) could put the points &quot;in order&quot;, given a starting point. It would put the points in order, strating witrh a given point, then arrange the points in ordrr of next closest point, then next, etc. After having that list of points in order, it would be fairly straightforward (with script or lisp) to draw a pline through the points in order.
Does this approach have potential?

Another way might be to use a &quot;auto snapping&quot; 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.
 
CarlB os right.
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.
 
I like the Excel idea! Yes the points are all very close together. By eye it's very obvious which is the next point when they're on the screen. I can't use LISP in LT, but I've got a copy of Excel....only I very rarely use it and havn't a clue how to write a macro, and don't really have time right now to play with it.
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor