585,919 active members*
4,141 visitors online*
Register for free
Login
IndustryArena Forum > CAD Software > Autodesk > Importing X & Y points to AutoCAD- how plz?
Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2005
    Posts
    1468

    Importing X & Y points to AutoCAD- how plz?

    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. #2
    Join Date
    Mar 2003
    Posts
    35538
    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

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Nov 2005
    Posts
    1468
    Thanks Ger!

    I know you be a busy man and so your reply is very much appreciated :cheers: - 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.
    Attached Files Attached Files
    I love deadlines- I like the whooshing sound they make as they fly by.

  4. #4
    Join Date
    Mar 2003
    Posts
    35538
    A clean file with just the X and Y values with a space between them would be easiest.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  5. #5
    Join Date
    Nov 2005
    Posts
    1468
    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!
    Attached Files Attached Files
    I love deadlines- I like the whooshing sound they make as they fly by.

  6. #6
    Join Date
    Aug 2006
    Posts
    65
    GER21 what macro do you have that reads pointclouds in mach3...


    9lrac9

  7. #7
    Join Date
    Mar 2003
    Posts
    35538
    Quote Originally Posted by 9lrac9 View Post
    GER21 what macro do you have that reads pointclouds in mach3...


    9lrac9
    http://www.cnczone.com/forums/showthread.php?t=33655
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  8. #8
    Join Date
    Mar 2003
    Posts
    35538
    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.
    Attached Files Attached Files
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  9. #9
    Join Date
    Nov 2005
    Posts
    1468
    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.

  10. #10
    Join Date
    Nov 2005
    Posts
    1468
    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).
    Attached Thumbnails Attached Thumbnails sts3d01.jpg  
    I love deadlines- I like the whooshing sound they make as they fly by.

  11. #11
    Join Date
    Mar 2003
    Posts
    35538
    Works fine in 2002 here, and also worked in 2007. When do you get the error?
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  12. #12
    Join Date
    Mar 2003
    Posts
    35538
    Here's the macro results of your sample file you posted.
    Attached Files Attached Files
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Similar Threads

  1. Trouble importing DXF files from autocad to Mach2
    By stickman3 in forum Mach Mill
    Replies: 4
    Last Post: 06-10-2007, 04:48 AM
  2. points cloud to dxf converter?
    By satchid in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 09-01-2006, 06:21 PM
  3. Points on arcs
    By gguidi in forum Autodesk
    Replies: 2
    Last Post: 07-25-2006, 01:49 PM
  4. position of points
    By TPPJR in forum OneCNC
    Replies: 3
    Last Post: 01-04-2006, 07:19 PM
  5. wanted: cloud of points
    By twombo in forum Uncategorised CAM Discussion
    Replies: 3
    Last Post: 05-23-2003, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •