Results 1 to 12 of 12

Thread: Importing X & Y points to AutoCAD- how plz?

  1. #1
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1468
    Downloads
    0
    Uploads
    0

    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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22211
    Downloads
    0
    Uploads
    0
    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. #3
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1468
    Downloads
    0
    Uploads
    0
    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.
    Attached Files Attached Files
    I love deadlines- I like the whooshing sound they make as they fly by.


  4. #4
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22211
    Downloads
    0
    Uploads
    0
    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
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1468
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Aug 2006
    Location
    usa
    Posts
    65
    Downloads
    0
    Uploads
    0
    GER21 what macro do you have that reads pointclouds in mach3...


    9lrac9


  • #7
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22211
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by 9lrac9 View Post
    GER21 what macro do you have that reads pointclouds in mach3...


    9lrac9
    Load Mach3 point clouds into AutoCAD
    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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22211
    Downloads
    0
    Uploads
    0
    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

    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
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1468
    Downloads
    0
    Uploads
    0
    Thanks mate, will try it today- couldn't yesterday cos I was having Real Life hassles.

    Many thanks for your help!

    Iain
    Last edited by ImanCarrot; 08-09-2007 at 03:36 AM.
    I love deadlines- I like the whooshing sound they make as they fly by.


  • #10
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1468
    Downloads
    0
    Uploads
    0
    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 Importing X & Y points to AutoCAD- how plz?-sts3d01.jpg  
    Last edited by ImanCarrot; 08-09-2007 at 08:29 AM.
    I love deadlines- I like the whooshing sound they make as they fly by.


  • #11
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22211
    Downloads
    0
    Uploads
    0
    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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22211
    Downloads
    0
    Uploads
    0
    Here's the macro results of your sample file you posted.
    Attached Files Attached Files
    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)


  • Similar Threads

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

    Posting Permissions



    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.