603,939 active members*
1,770 visitors online*
Register for free
Login
IndustryArena Forum > CAD Software > Autodesk > AutoCAD 2 G-Code macro
Page 1 of 12 12311
Results 1 to 20 of 225
  1. #1
    Join Date
    Mar 2003
    Posts
    35494

    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
    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)

  2. #2
    Join Date
    Sep 2004
    Posts
    28
    Hi Ger:

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

    Thanks
    Jim

  3. #3
    Join Date
    Mar 2003
    Posts
    35494
    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 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)

  4. #4
    Join Date
    Feb 2005
    Posts
    124
    I've tried it in 2004 but he said: "no objects selected". What does that mean?

  5. #5
    Join Date
    Mar 2003
    Posts
    35494
    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 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
    Join Date
    Mar 2003
    Posts
    35494
    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.
    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)

  7. #7
    Join Date
    Mar 2003
    Posts
    35494
    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.
    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
    35494
    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.
    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
    Mar 2003
    Posts
    35494
    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.
    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)

  10. #10
    Join Date
    Mar 2003
    Posts
    35494
    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.
    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)

  11. #11
    Join Date
    Mar 2003
    Posts
    35494
    Anyone using this? Over 200 downloads and not a single bit of feedback.
    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
    Feb 2005
    Posts
    124

    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
    Join Date
    Mar 2003
    Posts
    35494
    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 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
    Join Date
    Feb 2005
    Posts
    124
    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
    Join Date
    Mar 2003
    Posts
    35494
    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 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)

  16. #16
    Join Date
    Mar 2003
    Posts
    35494
    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.
    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
    Join Date
    Mar 2003
    Posts
    35494
    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 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)

  18. #18
    Join Date
    Mar 2004
    Posts
    564
    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.
    menomana

  19. #19
    Join Date
    Feb 2005
    Posts
    578

    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
    Join Date
    Mar 2003
    Posts
    35494
    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
    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)

Page 1 of 12 12311

Similar Threads

  1. parametric programming
    By Karl_T in forum CamSoft Products
    Replies: 21
    Last Post: 05-24-2005, 08:58 PM
  2. AutoCAD offsets and copying
    By skippy in forum Autodesk
    Replies: 14
    Last Post: 05-19-2005, 07:12 PM
  3. AutoCad 2000 DXF Question
    By Holmes_ca in forum Autodesk
    Replies: 8
    Last Post: 01-20-2005, 12:50 AM
  4. Autocad LT verse AutoCad LT
    By cncadmin in forum Autodesk
    Replies: 2
    Last Post: 02-03-2004, 02:28 PM

Posting Permissions

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