» Topic: Change editor
- July 6, 2013 at 9:44 pm #14046
Is it possible to change the default editor in BC v25 to something other than the Predator CNC Editor?
CalumJuly 8, 2013 at 4:33 pm #14127
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.
July 8, 2013 at 5:12 pm #14139
- This reply was modified 3 years, 2 months ago by cheezewiz.
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.
CalumJuly 9, 2013 at 8:41 am #14141
Here is basically the way VBScript can open another program:
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.July 9, 2013 at 9:06 am #14142
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
BCC_FILE = MILL_GetProgramName()
Sub Run(ByVal sFile, sAttr)
Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & sFile & Chr(34) & sAttr, 1, false
Set shell = Nothing
' Execute the program notepad.exe and open 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.July 9, 2013 at 8:38 pm #14212
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.
CalumJuly 10, 2013 at 8:18 am #14213
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.July 10, 2013 at 8:49 pm #14345
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.
CalumNovember 6, 2014 at 8:07 pm #20337
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, falseNovember 19, 2014 at 9:10 am #20420
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!November 20, 2014 at 1:00 pm #20434
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.November 20, 2014 at 1:33 pm #20435
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.
You must be logged in to reply to this topic.
- Load a V carve tool into 3 axis operation by mgdpapa2 weeks, 1 day ago
- version 28 large NC file when posted by [email protected]2 weeks ago
- error r6025/bobcad v27 glitches w/windows10 by jakeg2 weeks, 3 days ago
- 3d mill angled headstock by eric6 days, 3 hours ago
- Machining Strategy by ajhalls3 weeks, 5 days ago