Open Source Sofware

» Topic: Change editor

Home New Forums BobCAD-CAM Forums Change editor

This topic contains 11 replies, has 4 voices, and was last updated by  Mark 2 years ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #14046

    calum
    Participant

    Is it possible to change the default editor in BC v25 to something other than the Predator CNC Editor?

    Calum

    #14127

    cheezewiz
    Participant

    What other program would you like to use?

    BobCAD can use VBScript to open other programs and pass information to them. You must code it yourself of course. But it isn’t as hard as it might sound.

    You always, of course, can simply hit “Post” and then manually open the G-Code file. It is automatically created and then saved in this folder by default:

    C:\BobCAD-CAM Data\BobCAD-CAM V25\NC\Mill

    You can change this default location to anywhere Windows will allow. It won’t let you save to “permission” protected folders for example.

    • This reply was modified 3 years, 5 months ago by  cheezewiz.
    #14139

    calum
    Participant

    OK Thanks I’ll look into that, guess I need to do some research. I have been doing it manually and thought it would be nice to use the CNC Edit option in the post window to open Bob Warfield’s G-Wizard editor directly.

    Cheers
    Calum

    #14141

    cheezewiz
    Participant

    Here is basically the way VBScript can open another program:

    http://customerfx.com/pages/crmdeveloper/2004/02/10/how-to-execute-a-file-program-in-vbscript.aspx

    Opening G-Wizard when you hit “Post” is as easy as modifying the script in that link, replacing Run “C:\Program Files\MyFile.exe” with the G-Wizard exe

    The trick is then getting G-Wizard to open a specific file, with a specific path (the BobCAD “NC” folder). The developer of G-Wizard could probably help you with how to write the “Run” command. Once you have that, come back here and I’ll try to help you get the rest done. The BCC scripting variable MILL_GetProgramName() will grab the filename and path for you.

    #14142

    cheezewiz
    Participant

    If you want an working example just to get you on the right path, open your Post Processor in notepad and paste this at the bottom:

    2101. Read entire file after post.

    'Gather the file name/path
    Dim BCC_FILE
    BCC_FILE = MILL_GetProgramName()

    Sub Run(ByVal sFile, sAttr)
    Dim shell

    Set shell = CreateObject("WScript.Shell")
    shell.Run Chr(34) & sFile & Chr(34) & sAttr, 1, false
    Set shell = Nothing
    End Sub

    ' Execute the program notepad.exe and open BCC_FILE
    Run "notepad.exe",BCC_FILE

    When you hit post, notepad will open up and you will find your G-Code file ready for editing. Now you just need to change it to open Gwizard instead.

    #14212

    calum
    Participant

    OK Thanks, I’ve tried replacing the “notepad.exe” with the full path and GwizardE.exe,
    Run “C:\Program Files (x86)\GWizardE\GWizardE.exe”,BCC_FILE

    this open Gwizard editor but with an error “sorry can’t run file”

    Bob the creator of Gwizard editor says all the is needed is “Just one parameter and that is the filename to load, full path “

    I know nothing about VB so would appreciate your help.

    Calum

    #14213

    cheezewiz
    Participant

    Hmm, can you tell if it’s a Windows error box or a G-Wizard error box?

    MILL_GetProgramName() is the fully qualified path so that shouldn’t be the problem. I’m thinking we may need to just change the format of the G-Wizard call a little bit. Let me do some investigation on this but I might be stuck. If you could bug Mr. Warfield just once more, ask if his program supports OLE Automation. You might need to know the specific object model to call from G-Wizard to automate the load file operation.

    #14345

    calum
    Participant

    OK Bob Warfield tells me GWE dosen’t support OLE automation and he is having a look at the issue. He believes it is at his end and has reliesed a new version for me to try. I sitll get the same error which is a app error not Windows.

    I’m not if you can change the format of the run command to make it work while Bob is thinking about his end.

    Calum

    #20337

    Aaron
    Participant

    I like your little script but it has one little error. sAttr must also be escaped as the default save location has a space in it. Your shell.Run line should look like this:

    shell.Run Chr(34) & sFile & Chr(34) & Chr(34) & sAttr & Chr(34), 1, false

    #20420

    cheezewiz
    Participant

    Hello Aaron! I’ll be honest, I swiped it straight from the link above (actually it was one of the commenters additions to open a specific file).

    It’s been a while since I looked at this so it might take me a moment to get my head back into it (I am a novice VBScript user at best). I tried your alteration but I get a notepad error: The filename, directory name, or volume label syntax is incorrect.

    Whoops, nevermind. I only had the escape after sAttr, not before and after. Maybe that’s why the GWizard launch wouldn’t work? I would appreciate your insight. I’m always a learner. Thanks Aaron!

    #20434

    Mark
    Participant

    I can’t get this to work for EDM posts, there doesn’t seem to be an equivalent to MILL_GetProgramName(). Anyone have any ideas.

    Thanks Mark.

    #20435

    Mark
    Participant

    Done a bit more testing and the sub “2101. Read entire file after post.” doesn’t run at all in EDM posts so this might be a waste of time trying to sort out.

    Mark

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Forum Account

     Lost Password / Register   

Sharing

facebooktwittergoogle_pluspinterestlinkedinmail