Gcodein - lisp program to read cnc files into autocad


Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: Gcodein - lisp program to read cnc files into autocad

  1. #1
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default Gcodein - lisp program to read cnc files into autocad

    This is a link to a zip file that contains gcodein.fas and a readme.txt file.

    You can use it to read a cnc mill file into Autocad. I also have a lathe version I will post on my website later.

    intergate.com/~wjb1/wjbzone/autocad/gcodein.zip

    Bill

    Similar Threads:


  2. #2
    Registered cncadmin's Avatar
    Join Date
    Mar 2003
    Location
    United States
    Posts
    6855
    Downloads
    3
    Uploads
    4

    Default

    What does that do?

    Thank You,
    Paul G

    Check out-
    [URL="http://www.signs101.com"]www.signs101.com[/URL]


  3. #3
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    You can read a cnc gcode file into an Autocad layer.

    1. Launch your Autocad application.
    2. Use appload to load the gcodein.fas.
    3. Type gcodein at the Autocad command line.
    4. Browse locate your cnc gcode file.

    The cnc file is read into the current Autocad layer as lines and arcs.
    You can step one line at a time or set the number of lines to step.

    I use to verify my code before I run it on my machine.

    Bill



  4. #4
    Registered cncadmin's Avatar
    Join Date
    Mar 2003
    Location
    United States
    Posts
    6855
    Downloads
    3
    Uploads
    4

    Default

    OK, thanks I understand now.

    Thank You,
    Paul G

    Check out-
    [URL="http://www.signs101.com"]www.signs101.com[/URL]


  5. #5
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34664
    Downloads
    0
    Uploads
    0

    Default

    It would be nice if the step number stayed the same so you could just hit enter or right click to step through, right now I had to type the step amount each time. Other than that, it seems to work pretty good.

    Gerry

    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)


  6. #6
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    "It would be nice if the step number stayed the same so you could just hit enter..."

    Gerry,
    That's the way it works. At each pause in execution, the default step number is displayed at the beginning of the command line.
    i.e.
    if the default is 1 the command line reads:
    "1 Enter Step Increment (0 to Continue)"
    if the default is 20 the command line reads:
    "20 Enter Step Increment (0 to Continue)"

    The number at the beginning of the line (the 1 or the 20 shown above) is the default number of steps if you just hit the enter key.

    The only time you should have to type a number is when you want to change the default (can be any positive number).

    Type a 0 (zero) to run without a pause.

    Let me know that is not working for you.

    I'll try to make that more obvious in next revision.

    Bill



  7. #7
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34664
    Downloads
    0
    Uploads
    0

    Default

    My mistake, it does seem to work properly. One thing I noticed with code generated from MeshCAM, It crashed if the first move was:

    G1 Z0.00 F10.00

    I'm guessing it didn't have a place to start with just the Z-value in the first line.

    Gerry

    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
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    You got me on that one. Looks like a G0 or G1 with a zero move at the start of the program is a problem. I'll get that fixed as soon as I have a chance. Got to to some painting first today.

    Will post again as soon as it's fixed.

    Bill



  9. #9
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    I got the program updated. Fixed the problem with the first move.

    The link on the first post of this thread is the current version.

    Bill



  10. #10
    Registered
    Join Date
    Oct 2003
    Location
    USA
    Posts
    263
    Downloads
    0
    Uploads
    0

    Default

    Hi,

    Can you use this with AutoCAD 14 and if so, how? I've never run across a .fas file before.



  11. #11
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    Sorry mrainey,
    I don't believe a .fas file can be read into Autocad 14. The lisp routine uses several visual lisp functions. These are supported by Autocad 2000 and above.
    Bill



  12. #12
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    Another update to the gcodein program has been posted. I also put the lathe version (gcodeinL) on my website. (in the Autocad section)

    Bill



  13. #13
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34664
    Downloads
    0
    Uploads
    0

    Default

    BIll, I found a bug in you're program. I'm writing a VBA program to export G-code right from AutoCAD and I was using you're program to test the output. I didn't look into it too much, but I think you're not handling G2 or G3 correctly for arcs greater than 180°. If you try it with the following code, the center of the G3 is not what's specified.

    G1 X-5.6406 Y-11.7226 Z0.2500
    G1 X-2.8821 Y-8.2443 Z0.2500
    G3 X-5.1488 Y-8.3814 I-1.1948 J0.9476
    G1 X-4.3407 Y-9.1800 Z0.2500

    This is incremental I and J, btw. I loaded the code into the KCAM demo and it displayed fine. Just thought I'd let you know.

    Gerry

    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)


  14. #14
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    Gerry,

    Got that one fixed. It now will handle a arc greater then 180 degrees using I and J.

    Let me know if you find anything else.

    Bill



  15. #15
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    I modifed the gcodein file again. Did not change the revision number.
    Had a problem with cw arcs using I and J after fixing the previous error.

    (current version is modified 12/29/2003 3:27pm)

    Bill.



  16. #16
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34664
    Downloads
    0
    Uploads
    0

    Default

    Bill, one thing you should do here is get the value of OSMODE (Osnaps) and reset it when you're done. Every time I run this it turns off my snaps
    One other thing, anything over 999 you're not drawing in the right place I noticed. Is this a bug or intentional. I found this out by running a rather large drawing through my exporter, and reading it in with yours. (It's kind of neat watching it duplicate my drawing while I watch).

    Gerry

    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)


  17. #17
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    Gerry,
    I do save and restore the osmode in gcodein. I checked it out and it resets my osnap to the original settings.

    I think I know what the problem is with the 999. I'll try to get that bug fixed tomorrow. I never ran into the limit with my scale of drawing (in inches).


    Bill.

    One thing I want to figure out is how to make the open file dialogue box default to the autocad drawing folder.



  18. #18
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    Got rev 1f posted.

    Release 1f 1-30-04
    changed open file dialog box to default to current drawing directory
    change to allow coordinate values greater than 999
    change to reset color to previous value
    change method of restoring osnap

    I did not try the 999 coord. fix, let me know if it's working.
    Bill



  19. #19
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    34664
    Downloads
    0
    Uploads
    0

    Default

    One thing I want to figure out is how to make the open file dialogue box default to the autocad drawing folder
    You might be able to use the PROJECTNAME variable to help with this. I've never used it, just found it in a quick look through the help file. As for the Osnaps, I've never really looked into it, I just noticed that everytime I've played around with your Gcodein My snaps always ended up turned off. I just use something like this

    at the beginning of your code
    (setq osold (getvar osmode))


    at the end of your code
    (setvar osmode osold)

    Gerry



  20. #20
    Registered wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    415
    Downloads
    0
    Uploads
    0

    Default

    I used the dwgprefix (read only) variable to get the path. The file dialog box is now defaults to the current active drawing directory.


    For the osnap, I had been using (command "osmode" osold)

    I changed it to:
    (setq osold (getvar "osmode"))

    (setvar "osmode" osold)

    The problem with the coords had to do with the way I parsed through each line. I stopped looking after 7 digits. I set it up to 12 digits now.

    Bill



Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Gcodein - lisp program to read cnc files into autocad

Gcodein - lisp program to read cnc files into autocad

Gcodein - lisp program to read cnc files into autocad