AutoCAD 2 G-Code macro


Page 1 of 12 123411 ... LastLast
Results 1 to 20 of 225

Thread: AutoCAD 2 G-Code macro

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

    Default AutoCAD 2 G-Code macro

    I'm starting a new thread for the macro I'm working on.

    It will read lwpolylines, 3Dpolylines, and circles and output machine-ready (hopefully) g-code.

    All known bugs have been fixed, hopefully I didn't add more.

    Added 2 more selection options.

    Also added G83 drill cycles, which applies if the specified tool diameter is the same size as circles in the drawing.

    The included .pdf is up to date, but it still needs more work.

    Here's a link to the latest version:
    http://tinyurl.com/yglfz3e

    Similar Threads:
    Last edited by ger21; 11-16-2009 at 08:05 AM. Reason: Add link to latest version
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


  2. #2
    Registered
    Join Date
    Sep 2004
    Location
    Canada
    Posts
    28
    Downloads
    0
    Uploads
    0

    Default

    Hi Ger:

    Will your macro convert v14 dwg format to gcode or just dxf format.

    Thanks
    Jim



  3. #3
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    It doesn't convert files. It runs inside AutoCAD and exports g-code from within AutoCAD. You could open your drawings (either .dwg or .dxf) in AutoCAD, and run the macro to export. It's a VBA macro, you need at least AutoCAD 14.1 (or is it 14.01?) with VBA support. It's written in 2002, I haven't tried it in R14.1. You may need 2000 or newer for it to work.

    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


  4. #4
    Registered
    Join Date
    Feb 2005
    Location
    The Netherlands
    Posts
    124
    Downloads
    0
    Uploads
    0

    Default

    I've tried it in 2004 but he said: "no objects selected". What does that mean?



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

    Default

    I'm assuming that the main dialog box opens. If so, click the "Select Objects" button in the upper left corner. After clicking the button, the number of selected objects is displayed below the button. You have to select the entities you want to write the g-code for.

    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    I added the circle pocketing. This will create spiral pocketing passes.

    I mistakenly changed the filename of the previous macro, so the info in the .pdf on making a toolbar button was incorrect. This version and all subsequent versions will keep the same filename, so if you do create a toolbar button, it won't have to be modified with each update.

    Can anyone tell me if this works OK in ACAD 2004 or 2005? I'm writing it in 2002, but it should work in newer versions.

    Last edited by ger21; 02-09-2005 at 10:56 PM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


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

    Default

    Someone requested the ability to reverse polylines. There's a LISP to do that here: http://www.cadmicro.com/categories/RevPolyline.zip
    According to this page on the site, http://www.cadmicro.com/categories/b6_caddesk.htm , it's a 30 day evaluation. After you load it, the command is REVPL.

    Here's a completely free one. http://www.freecadapps.com/swdetails...owcolor=fce08d
    Command is RPL.

    Last edited by ger21; 02-07-2005 at 10:33 PM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    Added the last option, Bi-Directional cutting. This should work good for cutting slots. The tool will plunge straight down, cut the line, and when it reaches the end, plunge down for the next pass and return. Back and forth until the desired depth is reached. More info in the .pdf.

    Now that everthing is working ( I hope ), I won't be updating this again except to fix bugs (although noone's reported any). I'm going to build my router now so I can actually use this.

    Last edited by ger21; 02-12-2005 at 01:41 AM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    I found a bug if you use G41/G42 for circles. The lead-in move will gouge the circle. I'll upload a fix this weekend. Also, I think that I'm specifying the tool size wrong in all G41/G42.

    Edit: I got the info I needed from Art (Mach2), so I'll have this fixed late tonight or tomorrow morning.

    Last edited by ger21; 02-11-2005 at 09:51 AM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


  10. #10
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    Fixed the G41/G42 problems. Holes cut using G41/G42 now appear correctly in Mach2.

    Edit 2-13-05:
    Removed comma seperator for values of 1000 or more.

    Last edited by ger21; 04-12-2005 at 12:04 PM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


  11. #11
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    Anyone using this? Over 200 downloads and not a single bit of feedback.

    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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
    Registered
    Join Date
    Feb 2005
    Location
    The Netherlands
    Posts
    124
    Downloads
    0
    Uploads
    0

    Exclamation

    Quote Originally Posted by ger21
    Anyone using this? Over 200 downloads and not a single bit of feedback.
    Downloaded it but I can't use it in Mechanical desktop.

    Then I do sketch solving and when I place dimensions, your software doesn't recognize circles and lines anymore :frown: ...



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

    Default

    I don't use mechanical desktop, but do the lines and circles get moved out of model space? If so, try using the user selected option and select them individually. That's the only selection method that works with objects not in model space.

    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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
    Join Date
    Feb 2005
    Location
    The Netherlands
    Posts
    124
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by ger21
    I don't use mechanical desktop, but do the lines and circles get moved out of model space? If so, try using the user selected option and select them individually. That's the only selection method that works with objects not in model space.
    I've tried that before, no results.

    Maybe becouse I use 2004 version?(acad and mechanical are practically the same)



  15. #15
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    I'm pretty sure people have used it in 2004 without problems. In a few weeks, I'll check it out with 2005.

    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


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

    Default

    Quote Originally Posted by ger21
    Fixed the G41/G42 problems. Holes cut using G41/G42 now appear correctly in Mach2.
    I had posted earlier that G41/G42 were incorrect. But I now have a feeling they are working properly. I really need to get my router done so I can test things a little better.

    Last edited by ger21; 03-24-2005 at 07:11 PM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    The G41/G42 do seem to be correct (for Mach2/3). But if you use them, it's a good idea to put a G40 on the first line of code. This will prevent errors in Mach3 if you stop the program in the middle of a G41/G42 and rewind it. Mach2/3 will remain in G41/G42 mode if that happens, and you could get an error. G40 on the first line will turn off the G41/G42 if it's still active.
    I exchanged a few emails with Art, and next week he's going to be redoing the Cutter Comp in Mach3. Hopefully it will be a little more powerful and user friendly. I'll change my macro to accomodate any advances there, as I try to Use G41/G42 whenever possible.

    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


  18. #18
    Registered
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    564
    Downloads
    0
    Uploads
    0

    Default

    Ger21 I wil deffinetly use it when my machine is complete.
    I am trying to do something similar with ordinates and points to be transfered to a spreadsheet right now, and am learning about how you created macros, so you are helping me indirectly understand that too.
    thanks

    also thanks for the links to the free cad stuff.

    Industrial automation ????
    www.challengermechtech.ca


  19. #19
    Registered spalm's Avatar
    Join Date
    Feb 2005
    Location
    USA
    Posts
    578
    Downloads
    0
    Uploads
    0

    Default Cutter Comp

    Gerry thanks for the macro.

    I have a real newbie question here. If I draw a rectangle in AutoCad, and then generate G-code, how do I tell cutter to stay inside or outside of that rectangle? There are cases where I would want either one. Right now I am compensating for it in the dimensions in AutoCad, but there must be an easier way.

    Thanks,
    Steve



  20. #20
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35528
    Downloads
    1
    Uploads
    0

    Default

    If you use Mach2, or a controller that uses G41/G42, the controller will offset the tool according to the direction you draw the rectangle. But, DON'T use the rectangle command, and you'll have to add a lead-in move, and possibly a lead-out move. The attached drawing will offset to the outside with G42(offset right), or the inside with G41 (offset left). My macro outputs the code in Mach2 format. You'll probably have to edit it if you're not using Mach2/3. Also, you can use the extra lead-in move to ramp into the material. Just check the ramp entry box. Same with the lead out if you want to ramp out of the cut, check the ramp exit box.


    You need to know which way the line is drawn. You can check this by opening the properties window with the line selected, and clicking on the line that says vertex. You can cycle through the vertices to see which way the line goes. Vertex 1 is the start.

    Attached Files Attached Files
    Last edited by ger21; 03-31-2005 at 02:06 PM.
    Gerry

    UCCNC 2022 Screenset
    http://www.thecncwoodworker.com/2022.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)


Page 1 of 12 123411 ... 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

AutoCAD 2 G-Code macro

AutoCAD 2 G-Code macro

AutoCAD 2 G-Code macro