Saturday, November 29, 2014

Some little things I've learned about G7


When I first double-clicked the icon on my desktop to start G7, it opened a configuration utility that said my "Present Working Directory" was C:\G7\Demo\Basic_G.

(Actually, at the time it said C:\PDG\Demo\Basic_G but I have since changed the name of the installation folder to G7 because "PDG" doesn't mean anything to me. I will just refer to it as the G7 folder, and pretend it was always thus.)

The configuration utility identified my Present Working Directory, my Workspace Bank (ws.bnk) and my Default Bank (mrts.bnk).

When I clicked OK, the Configuration Utility closed and two other windows opened -- the G7 program, and an editor containing the basicg.add script.

When I closed the program and came back to it later, it identified the same working directory and the same banks. And it opened showing the same text it showed the first time.

I went around that circle a few times. But then I renamed my G7 installation folder from C:\PDG to C:\G7. And after that, the original demo wouldn't work. I finally solved that problem by using the BROWSE button in the Configuration Utility. The button opens a regular, Windows-looking FILE OPEN window and lets you change the working directory and select a configuration file.

In the Demo folder, for example, is a Graph folder and in the Graph folder is a G.CFG file. When I opened that config file the Present Working Directory and the Default Bank changed in the Configuration Utility. When I clicked OK to close the utility, G7 opened in the Graph folder, with a graph.add file open in the editor.

If I then close G7 and open it up again, it comes back with the Graph folder as the working directory and graph.add in the editor, just as it was when I closed G7.

So this tells me how to get the original demo back: Start the Configuration Utility, click BROWSE, move from the Demo\Graph folder, to the Demo folder, to the Demo\Basic_G folder, and open the G.CFG file I find there.

Click OK to close the Configuration Utility, and you are back to the original demo that came up the first time you started G7. Almost. The text field at the right end of the G7 toolbar says the graph.add file is still loaded and ready to run -- even though you can see the basicg.add file in the editor, plain as day.

So I clicked the LOAD button on the G7 toolbar, and double-clicked the basicg.add file to make it replace the graph.add file. After that, the original demo worked just like it did at the start.

So what did I learn?
  •   G7 wants to start up where it left off.
  •   That makes the BROWSE button a very useful tool, and
  •   it makes the LOAD button a very useful tool.

It seems a little odd maybe that one script file is loaded in the editor, and a different script file is loaded in G7. But I've seen that before, with Lisp files and AutoCAD. You have the Lisp file open in the editor, and you add some code to it, and you run the thing and it doesn't work. No, because the changes you made are only in the file you are editing, not in the file that is loaded into AutoCAD.

The Lisp editor solves the problem by giving you a way to "load" the file into AutoCAD. They don't say that you're loading it into AutoCAD. They just say that you're loading it. But after you do it, AutoCAD knows about the changes you made. And now you can test them out.

With G7, after you use the BROWSE button and change things in the Configuration Utility, when you get to G7 you have to click the LOAD button to load the script into G7, even though it is already loaded into the editor.

It's strange how similar this is, what happens in AutoCAD and what happens in G7.

No comments: