As a result of the work you did in Lesson 3, your gpmain.lsp file was getting rather large. This is not a problem for VLISP, but it is easier to maintain the code if you split things up into files containing logically related functions. It's also easier to debug your code. For example, if you have a single file with 150 functions, a single missing parenthesis can be difficult to find.
In the tutorial, the files will be organized as follows:
To split gpmain.lsp into four files
- Create
a new file, then cut and paste the following functions from gpmain.lsp into
the new file:
- gp:getPointInput
- gp:getDialogInput
- Create
a new file, then cut and paste the following functions from gpmain.lsp into
the new file:
- Degrees->Radians
- 3Dpoint->2Dpoint
- gp:list->variantArray
Also, at the beginning of the file, insert the lines of code to establish ActiveX functionality (vl-load-com) and commit global variable assignment (*ModelSpace*).
- Create
a new file, then cut and paste the following function from gpmain.lsp into
the new file:
- gp:drawOutline
- After stripping the code out of gpmain.lsp, save it and check it. Only the original function, C:GPath, should remain in the file.
Your
VLISP desktop is starting to get crowded. You can minimize any window
within VLISP and it stays accessible. Choose the Select Window button on
the toolbar to choose a window from a list, or choose Window from
the VLISP menu and select a window to view.