AutoCAD 2 G-Code macro - Page 4


Page 4 of 12 FirstFirst 1234567 ... LastLast
Results 61 to 80 of 225

Thread: AutoCAD 2 G-Code macro

  1. #61
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    The end result was a 3D surface, but all it was in AutoCAD was a bunch of 3D splines converted to 3D polylines. (Actually 2d splines using the X and Z axis).

    My macro will follow 3D polylines. If you model using meshes, you could draw 3D polylines through all the vertices of the mesh and you'd have a 3D surface program. It would be quite tedious, though. And the model would need to be made bigger by the tool radius. I personally would use lower resolution meshes, and use splines and then convert them, which will give you higher resolution and smoother cuts.

    You gave me an idea. I should be able to write a macro to automatically draw either splines or 3D polylines through all the vertices of a mesh. I'll try to add that to the next version I do. Unfortunately, it won't be 'til next year. On the bright side, when finished It'll have about 3 times as many features. This one being one of the best. Thanks.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  2. #62
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default 3D surface g-code now supported...sort of

    I've created a way to create g-code for 3D surfaces in AutoCAD. Thanks to Jon for asking about this and making me think about it.

    I wrote a macro to create 3D polylines on the surface of a mesh. Model your surfaces in AutoCAD using the surface commands (revsurf, tabsurf, rulesurf, edgesurf), and then run the macro to create the 3D polylines. Then run the g-code macro, and you're ready to go!

    Download the mesh macro from here. http://www.cnczone.com/forums/showthread.php?t=12191

    One problem, though. There isn't any compensation for the tool size. On flatter surfaces it shouldn't be too bad. On steep surfaces your part will end up a bit smaller. You can try to compensate a little when creating the mesh, although it might be a bit difficult for some parts.

    Also, be aware that undercut surfaces will be cut right through.

    Even with the limitations, I think this is way cool.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  3. #63
    Gold Member
    Join Date
    Jun 2003
    Location
    United States
    Posts
    1365
    Downloads
    0
    Uploads
    0

    Default

    That sounds cool, Can you create surfaces by exploding a solid? If so, you might be able to offset them.

    Jon



  4. #64
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    You can in a roundabout way. Exploding a solid creates regions. Exploding a region leaves just the edges of the surface. As long as the surface has 4 edges, you can use the 4 edges and the EDGESURF command to make a mesh from it.

    Unfortunately, depending on the surface, simply offsetting it won't give you an accurate part. The tool tip will run through the vertices of the mesh. Assuming a round tool, on vertical walls the tool will cut the tool radius too deep. And offsetting will make the flat areas higher. You need a varying offset based on the angle from the horizontal. You can do it by drawing a series of vertical lines through the edge at fixed intervals. These intervals can be fairly large and still be accurate. Then offset the edge by the tool diameter. Draw circles the diameter of the tool at all the intersection points of the offset line and the vertical lines. Then, draw the new edge using a spline through the intersection of the vertical lines and the bottom of the circles. The red line in the attached pic is the new offset edge.

    This won't work if the edge can't be offset (3D lines can't be offset)

    Bottom line, if you need a precise surface, this is not the way to do it. Buy MeshCAM. But if close enough will do, it seems to work pretty good.

    Attached Thumbnails Attached Thumbnails AutoCAD 2 G-Code macro-offset-gif  
    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  5. #65
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    I posted a new version here. It fixes some small bugs I found, that no one else seems to have noticed. I haven't tested the fixes much, but they seem to work.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  6. #66
    Registered
    Join Date
    May 2004
    Location
    Canada
    Posts
    83
    Downloads
    0
    Uploads
    0

    Default

    Hello Gerry, have you had any luck with autocad 2000 yet?,

    Edmund


  7. #67
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    Sorry, Ed. Just don't have the time to look into it.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  8. #68
    Registered
    Join Date
    Sep 2005
    Location
    USA
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    It would be really neat if you could make it convert text to gcode as well. I have 2005, but I dont have the express tools so I can't do this with autocad alone. Not without jumping through a hoops anyway...



  9. #69
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    I thought 2005 came with the express tools? If you don't have them, download this and try it. http://www.freefirestudio.com/outline.htm

    Just export as .dxf and open into AutoCAD, and you're all set. If you need it in another drawing, just copy and paste it.

    I'm not a programmer, so figuring out how to convert fonts to polylines would be more work than everything else in there.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  10. #70
    Member wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    416
    Downloads
    0
    Uploads
    0

    Default

    [QUOTE=ger21]You can in a roundabout way. ...
    This won't work if the edge can't be offset (3D lines can't be offset)
    QUOTE]

    Gerry,

    If you want a accurate profile, another option is to re-draw the solid with the surfaces at the center of your ball endmill. Then explode.


    Bill



  11. #71
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    Quote Originally Posted by wjbzone
    If you want a accurate profile, another option is to re-draw the solid with the surfaces at the center of your ball endmill. Then explode.
    Bill
    Not sure if I follow you. Do you mean set up the tool so g-code is specifying the center of the tool? Otherwise I'd still have to do the offset like I described above, right?

    I wrote the Mesh to Polyline macro because it was easy to add. I envisioned it's use more for decorative type things where accuracy isn't that important. When I get a chance, I'll add the ability to export splines instead of polylines. Since the vertices of splines are quicker and easier to edit than polylines (since there are a lot less), it will make doing things like in the pic a lot easier.

    http://www.cnczone.com/forums/attach...achmentid=8897

    If I need precise surfaces, I'll use MeshCAM.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  12. #72
    Registered
    Join Date
    May 2005
    Location
    India
    Posts
    9
    Downloads
    0
    Uploads
    0

    Exclamation CNC code generator

    I have made this utility in Java
    CNC code Generator , it works great for AutoCAD 2000 DXF file.

    http://cnccodegen.sourceforge.net

    try out and let me know if you get any problems..

    Regards,
    Vijay



  13. #73
    Member wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    416
    Downloads
    0
    Uploads
    0

    Default

    [QUOTE=ger21]Not sure if I follow you. Do you mean set up the tool so g-code is specifying the center of the tool? Otherwise I'd still have to do the offset like I described above, right?
    QUOTE]

    That is what I mean, if you program the center of the tool (by redrawing the solid so that the surface is at the center of the tool) you can get the exact finish contour. If you run the g-code as posted you need to lower your ball endmill in the Z direction by the radius. It may not be easy to redraw, but it's an option.

    I saw that decorative contour a while back. I like the effect. Have you used it in any projects?

    Bill



  14. #74
    Registered Lionclaw's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    253
    Downloads
    0
    Uploads
    0

    Default

    Gerry, I was just using your macro to make the gcode for my bearing mounts and I had an idea.

    Usually I layout all of my cut lines. Then I run your macro and select all the objects for a certain depth of cut, and make a file "mypart_1", then select the next set of objects for another depth of cut and make file "mypart_2". When all is done I combine the files before running them on my machine.

    So I have either a question or a request, maybe both. I know setting an item's Z will indicate depth of cut, so how do I change the Z of a polyline or circle?

    The request would be for an "Append" button that would go right next to the "Write G-Code" button. That way I could just append my code to the file without having to open them all and copy/paste into one. The only major use I could think of for this would be as a crutch for getting around me not knowing how to set the Z of an object, so it may not be necessary

    Andy
    CNC Kits - http://www.comptonsoft.com/cncweb/


  15. #75
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    You're doing it the hard way.

    How do you change the Z? A couple ways. You can move it to the depth you want with the "move" command. Say you want a depth of .25. The move command will prompt for a basepoint. click anywhere, but I prefer to click in a blank area. For the second point of displacement, enter on the command line @0,0,-.25. That will move your object down .25.

    An easier way is to open the properties window with the object selected, and enter the depth in the line labeled "elevation" just click on the line and it will highlight the number. Make sure to use a negative number, like -.25

    Apparently you haven't used the coolest feature.

    Edit/ Assign Custom Properties

    Click this button, and then select your object (Only 1 at a time, though) A window will open and let you set the depth for that object only, as well as any other options pertinent to that object, such as feedrate, max depth per pass, ramping, cutter comp......

    Once assigned to the object, that info is stored with it in the drawing, so you can save the drawing and that machining info will be saved with it. You can also copy and paste, or array an object with custom properties and the multiples will have the same properties.

    Say you want a circluar array of pocket holes at a specific depth. Draw one circle, run the macro, and assign the depth you want. Exit the macro, and do a polar array on the circle you just aded the depth to. All the circles in the array will be cut to the same depth.

    The only reason I can see for needing to combine seperate g-code outputs into one file, is if you have too many objects to select the order, and the objects are not drawn in the correct order. With careful planning, this shouldn't even be a problem.

    One day when I get some time, I plan on seting up a website for the macro and writing some tutorials, but that's a ways off. And when I have the time, do I spend it writing tutorials, or a newer, much more powerful version of the macro???

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  16. #76
    Registered Lionclaw's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    253
    Downloads
    0
    Uploads
    0

    Default

    Thanks Gerry, that should make my life somewhat easier!

    I don't know what I'd have done without your macro. None of the other programs I've tried have liked me.

    Andy
    CNC Kits - http://www.comptonsoft.com/cncweb/


  17. #77
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    Let me know how it works for you, or if you have any more questions on how to do stuff.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  18. #78
    Registered bryanrabb's Avatar
    Join Date
    Feb 2006
    Location
    Fort Mill, SC
    Posts
    196
    Downloads
    0
    Uploads
    0

    Default

    where can I find your download?



  19. #79
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    Click on the word "here" in message #65 for the latest version.

    Last edited by ger21; 08-26-2006 at 08:49 PM.
    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  20. #80
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    For all those using AutoCAD 2000 and wanting to try my macro, bad news. I installed 2000 today and found a few major problems. VBA in 2000 doesn't have the Round and Formatnumber functions, which I used extensively. Since I'm not a programmer, I wouldn't know how to work around their absence. And even if I did, I'm not sure I'd want to go through all the code making all the needed changes. And their may be more problems that I'm not aware of.

    However, if their is someone with decent VBA skills and AutoCAD2000 that would like to tackle this, PM me. But remember, I'm not a programmer, and there is a LOT of sloppy code.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


Page 4 of 12 FirstFirst 1234567 ... 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