586,096 active members*
3,650 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > BobCad-Cam > Adding custom G-Code as a "Feature"
Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2013
    Posts
    0

    Adding custom G-Code as a "Feature"

    Hi All,

    We have recently started using BobCAD V25. I have been playing with the post processor and some VB scripting to try and customise it to work the way we want it to.

    One thing that it seems to be missing is a "feature" to add a line of custom G-Code to the Data-CAM Tree. This would be handy for when we want to add in say a call to a sub program that we have made in the past, without having to manually edit the G-Code after it has been posted.

    Has anyone managed to create a custom feature that can add in a line of G-Code, or do you have a workaround for this problem?

    Thanks

  2. #2
    Join Date
    Jun 2008
    Posts
    1838
    Quote Originally Posted by murchester2 View Post
    Hi All,

    We have recently started using BobCAD V25. I have been playing with the post processor and some VB scripting to try and customise it to work the way we want it to.

    One thing that it seems to be missing is a "feature" to add a line of custom G-Code to the Data-CAM Tree. This would be handy for when we want to add in say a call to a sub program that we have made in the past, without having to manually edit the G-Code after it has been posted.

    Has anyone managed to create a custom feature that can add in a line of G-Code, or do you have a workaround for this problem?

    Thanks
    Not able to have a "G code Feature" under the CAM Tree that I know of unless you create a Feature for the operation you want and then save it out and when needed it can then just be loaded back in any time anywhere in the new program and when the program is posted it will contain the G code for that operation where you want it

    Alternatively as you have already tried you can do this with the Post Processor, modify a Post to output what you need and then just use the modified Post when you need the extra code.

    Regards
    Rob
    :rainfro::rainfro::rainfro:

  3. #3
    Join Date
    Mar 2013
    Posts
    0
    Thanks Rob,

    I thought that might be the case. It seems like a basc feature that should really be in the software. I'm sure lots of people would find it useful.

    The main problem with using a saved feature work around is that it will always require a tool change (and a tool path). I think I would just find that annoying/time consuming and would rather change the code manually after posting! Or is there a way to get around the tool change and tool path?

    One thing that I am considering is adding a text box in the advanced posting page for each tool which can insert g-code before or after an operation.

    Thanks again,
    James

  4. #4
    Join Date
    Dec 2008
    Posts
    4548
    You could do this in your scripting. You would place the program blocks in the custom features in the appropriate places, then provide a method in the features edit dialogue to choose which of the program blocks your calling (Like "insert before this feature" and "insert after this feature") and then a dialogue to select your stored nc file to append to the codes output.

    I'm not much of a scripter so i cant walk you through it. I think I saw sbc do this exact thing in one of his previous scipted posts he was sharing.

    Do you know how to vbscript?

  5. #5
    murchester2 Guest
    Quote Originally Posted by BurrMan View Post
    You could do this in your scripting. You would place the program blocks in the custom features in the appropriate places, then provide a method in the features edit dialogue to choose which of the program blocks your calling (Like "insert before this feature" and "insert after this feature") and then a dialogue to select your stored nc file to append to the codes output.

    I'm not much of a scripter so i cant walk you through it. I think I saw sbc do this exact thing in one of his previous scipted posts he was sharing.

    Do you know how to vbscript?
    Thanks BurrMan,

    I don't quite follow sorry. I will need to have another play around with it. Any chance you could point me towards this sbc? It sounds like a good post. I am new to the forum and having a bit of trouble finding things...

    I can script a little, not very familiar with vb but I'm working it out. I have managed to write a few program blocks so far.

  6. #6
    BurrMan Guest
    Quote Originally Posted by murchester2 View Post
    Any chance you could point me towards this sbc?
    We'll just keep calling him out here. He reads this forum...

  7. #7
    BurrMan Guest
    Here is a start:

    http://www.cnczone.com/forums/bobcad..._template.html

    This isnt the "reads a stored nc file" that you need to script, but it talks about inserting text in places. So, as you mentioned, you could add a textbox to your features where you could manually paste stuff you wanted to insert, like sub programs.

  8. #8
    SBC Cycle Guest
    Quote Originally Posted by BurrMan View Post
    Here is a start:

    http://www.cnczone.com/forums/bobcad..._template.html
    So, as you mentioned, you could add a textbox to your features where you could manually paste stuff you wanted to insert, like sub programs.
    Yes, this is exactly how I would do it. It will require use of an advanced posting page for a feature type that you want to use as a "dummy" feature. For example, you could insert a "Drill" feature into the CAM tree but then have a custom adv. page where you can select a menu option to turn the "Drill" feature into a "Thread Mill" feature instead that will spit out a subroutine call at the hole locations. Or just about any custom code you want, really.

    Burr is right, the trick is finding and manipulating just the right spot to insert the code (without triggering unnecessary or incorrect tool changes). You can use VBScript (if you are well versed) to help you with that but knowing how the post processor works is vital for exploiting simple tricks to suppress code from being output and turning it back on.

    If you just need to insert code in an "easy" spot like between tool changes, this will be very easy to do. Work with the "debug" feature of the post processor and you will probably figure it out very quickly.

  9. #9
    murchester2 Guest
    Thanks SBC. I was hoping there would be a cleaner way to do this... I really want a solution that others in the workshop who program CNC could use without them needing to understand the post processor or add in messy features or un-intuitive workarounds that require tool changes etc which will increase the run time of the program.

    I will keep thinking on this one. Thanks for the help anyway.

  10. #10
    BurrMan Guest
    Quote Originally Posted by murchester2 View Post
    Thanks SBC. I was hoping there would be a cleaner way to do this... I really want a solution that others in the workshop who program CNC could use without them needing to understand the post processor or add in messy features or un-intuitive workarounds that require tool changes etc which will increase the run time of the program..
    Well, that all happens while your designing and programming the scripted post processor. After you acheive that, then it's just copy and past for the users in the shop. Pretty sure if you explore vb script a bit you can create a dialogue to just point to an nc file to insert to eliminate the copy and pasting part. Also, if the programming becomes beyond your capabilities, you could also call BobCad and pay them to produce one for you.

  11. #11
    SBC Cycle Guest
    Quote Originally Posted by murchester2 View Post
    Thanks SBC. I was hoping there would be a cleaner way to do this... I really want a solution that others in the workshop who program CNC could use without them needing to understand the post processor or add in messy features or un-intuitive workarounds that require tool changes etc which will increase the run time of the program.

    I will keep thinking on this one. Thanks for the help anyway.
    Do you have a simple example of what kind of custom G code you want to insert into the NC code? If you can, upload your post processor by zipping it up and I'll try to give you an example to work off of. As Burr said, it's probably going to be a one time setup that will be easy to use "on the floor". The ease of use will be related to how much effort you want to put into the scripts. They are pretty powerful. I can help but if you want something very fancy and complex, BobCAD staff can probably go a step above.

  12. #12
    Join Date
    Mar 2013
    Posts
    0
    Thanks guys, here is a post processor that we are using: Doosan NM410 New 3 - Metric.zip

    We want to be able to add one or more lines of code manually and place it in the BobCAD program tree between features. This could be so that we can move the machining table to a convenient position to re-position clamps, call a sub program for serial numbering etc....

    For example, in BobCAD we might have a "drilling feature", then a "g-code feature" which makes a call to a sub program to obtain a serial number, then an "engraving feature".

    If you get a chance to look at it, that would be much appreciated. It would be good to have a base example for me to work from.

    Cheers,
    James

Similar Threads

  1. Adding Mcodes or "poor man's part probe"
    By Wade C in forum Fadal
    Replies: 0
    Last Post: 06-03-2011, 08:23 PM
  2. "Simple" single tool change feature?
    By tubeguy in forum BobCad-Cam
    Replies: 4
    Last Post: 10-14-2010, 08:48 PM
  3. Error adding fillet "Couldnt add entity"
    By carbidecraters in forum BobCad-Cam
    Replies: 29
    Last Post: 09-27-2007, 07:21 PM

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
  •