![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Autodesk Software (Autocad, Inventor etc) Discuss Autodesk Software (Autocad, Inventor etc) software here. |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
OK, I've had no luck telling autocad that I want it to draw X and Y points according to a formula Z=f(X), exact formula below: Z=[X^2/{R+((R^2-((K+1)*X^2))^0.5))}] +A2^2 +A4^4 +A6^6 +A8^8 +A12^12 So I made a program in Basic that said... basicaly (you get the idea, not writing the whole code out): For X= 0 to DIA STEP INCR Z=f(X) Open 1,1,1 FILENAME$ Print #1, X;".";Z Next X Print #1 "EOF" Close #1 Now.. this gives me around 790 lines of co- ordinates in X and Y for a step size of 10um over an X travel of about 7.4mm. The sag (Z) values check out, so my code is ok. So.. I have the X, Y co- ordinates *bounces*. My question is... can I import this from a simple text file into Autocad so it draws the profile in 2D? Ie: Can I import over 700 X, Y co- ordinates into AutoCAD cos it is doing my nut in. I would dearly love to just give AutoCad the formula and say "step 0.01mm in X and figure it out Y yourself due to the formula", but there seems no way to do this. However... I am not daft enough to think that others don't know better than me myself and I. Any help greatly appreciated! Iain.
__________________ I love deadlines- I like the whooshing sound they make as they fly by. |
|
#2
| ||||
| ||||
| I can write the VBA code to do it, if you give me a week or two. What do you want to draw, a 2D polyline? Or just a series of points. I'll try to post some code for you as well to open a text file in AutoCAD and read the points. I have a macro that reads a point cloud from mach3 and creates a mesh of 3D faces. This should be similar. What format is the text file?
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#3
| ||||
| ||||
| Thanks Ger! I know you be a busy man and so your reply is very much appreciated - I've been trying to do this for a week or more and have resorted to actualy trying to programme something on my own that will print me a profile of the surface in 2D, but I'm sure there must be some way to do it within ACAD.I've got about half way through my own prog- it lets me take all the above variables and calculates the Z value for a given X value and repeats in steps determined by the increment. These values I can output as a text file- editeable in WordPad so I can manualy add the Prologue, side and back face. I can then rename it to a .JFL file (Job File) that my machine can read. My aim, however, is to be able to get all these X and Z values into ACAD as a set of point-to-point lines. I plan to REVOLVE these lines (after PEDIT) to create a solid 3D graphical representaion of the job to impress my customers (all the above variables change with each job, but the formula stays roughly the same- any alterations I can make in my prog easily enough). All I need ("all" I say, lol- been trying for a week!) is to be able to get ACAD to recognise a bunch of X and Z values and print these as a 2D line (note that ACAD calls it X and Y, I only call it X and Z cos of my lathe's terminology). Here's the X and Z values, ignore the prologe, side and back face etc, I only needed these in there for my machine to *stupidly* know what to do ![]() It's easy nuff for me to replace Z with Y if that helps, or even delete all the X's and Z's and stick a space in between them if that helps? Any ideas gratefuly received! Thanks in advance. Iain.
__________________ I love deadlines- I like the whooshing sound they make as they fly by. |
|
#4
| ||||
| ||||
| A clean file with just the X and Y values with a space between them would be easiest.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#5
| ||||
| ||||
| No problem! I deleted the X and leading space and the Z values which I replaced with a Space. Saved as Windows text default with a carriage return and linefeed (can delete these too if needed?). Thanks again for looking at this, you've helped me in the past and it's well appreciated!
__________________ I love deadlines- I like the whooshing sound they make as they fly by. |
| Sponsored Links |
|
#7
| ||||
| ||||
|
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#8
| ||||
| ||||
| Iman, try this, it seems to work OK. Reads your text file and draws a single polyline. Go to Tools>Macro>Load project and load the macro. Then use Tools>macro>macros and choose run. Pick your text file and away you go. There's no error trapping, so it will crash if the file format is not correct. Just X and Y coordinates separated by a space.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#9
| ||||
| ||||
| Thanks mate, will try it today- couldn't yesterday cos I was having Real Life hassles. Many thanks for your help! Iain
__________________ I love deadlines- I like the whooshing sound they make as they fly by. Last edited by ImanCarrot; 08-09-2007 at 02:36 AM. |
|
#10
| ||||
| ||||
| Hmm gives errors, file format is ok, might be my version of AutoCAD- I have 2002 on my Desktop, but I've got 2006 on my laptop- will try that. Errors are as follows: ***Fatal Error Unimplemented AcRx Class::Copy from () function invoked. ***Error handler re- entered. Exiting now. In fact, since I only need it for presentation purposes I manualy inputed the points (not all of them, just a few)... will work on it more laters. Got to go design lots of tooling (and am 2 weeks behind lol).
__________________ I love deadlines- I like the whooshing sound they make as they fly by. Last edited by ImanCarrot; 08-09-2007 at 07:29 AM. |
| Sponsored Links |
|
#11
| ||||
| ||||
| Works fine in 2002 here, and also worked in 2007. When do you get the error?
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#12
| ||||
| ||||
| Here's the macro results of your sample file you posted.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble importing DXF files from autocad to Mach2 | stickman3 | Mach Mill | 4 | 06-09-2007 10:48 PM |
| points cloud to dxf converter? | satchid | General CAM Discussion | 1 | 09-01-2006 12:21 PM |
| Points on arcs | gguidi | Autodesk Software (Autocad, Inventor etc) | 2 | 07-25-2006 07:49 AM |
| position of points | TPPJR | OneCNC | 3 | 01-04-2006 12:19 PM |
| wanted: cloud of points | twombo | General CAM Discussion | 3 | 05-23-2003 02:30 AM |