Monday, August 30, 2010

Testing...1, 2....testing

As you build a shared network "production" environment it is important to realize that multiple people are relying on that environment at any given time. Making the smallest change to production code can seem elementary and you will be tempted to just edit the production environment. There is no need to live on the edge and to get your heart pumping in anticipation as you open a production network file, edit one line of code, and click save.

Why put yourself through this stress? Setup a development network environment to test all of your changes before pushing it to the production environment. Editing one line of code invites room for error- an omitted semi-colon or a missing closing parenthesis are common simple oversights that can be caught immediately in the development environment to ensure a streamlined deployment into production.

To create a development area create a mirrored folder structure of your production environment. I create a dev folder at the same level as the production network folder. Inside of the dev folder is a copy of all of the production sub-folders and files.



Let's go ahead and create a new .arg (user profile) from AutoCAD for our development environment. Before doing this delete the .arg file that was copied into the _dev\Profiles folder. Open the production user profile in AutoCAD and we will create a new profile from the production profile. When the new profile is created we want to change the Enterprise Menu file location to point to our dev folder:



Now we can Export this development profile to our _dev\Profiles folder.

Depending on how you choose to manage your paths we may need to update a few lines of code in the .mnl file. Remember the .mnl file located in the same folder as the CUI will load automatically. The highlighted segment is what I changed.


;Title: SLD_dev.mnl
;Description: Automatically loads when SLD.cui is loaded.

;Constants
(setq SLD_DRIVE "X:\\")
(setq SLD_PATH (strcat SLD_DRIVE "SLD_dev\\Support\\"))
(setq SLD_TOOLS (strcat SLD_PATH "SLDTools.dll"))

;Load custom routines
(command "NETLOAD" SLD_TOOLS) ;netload sld functions
(load (strcat SLD_PATH "sld.lsp")) ;load lisp files

(princ "\nStreamlined content loaded!\n")

We can now update our desktop icon (in the _dev folder) to point to the development .arg file by changing the folder path and file name:




You can rename the development desktop shortcut so when you copy it to your desktop it will not be confused with the production environment.




Now we have two side by side environments, one that is production which is shared with your designers, the other which is identical to production but can be used for testing. When AutoCAD is launched from the development icon it will create a new profile so you can have both profiles loaded on your machine.





Any new custom files (lisp or dll) can be modified, created, and tested in the development area first. Also, CUI edits can be done in the development area before being visible to everyone. The CUI content will not be using hard paths so as long as it is relying on AutoCAD support paths then it will function fine when transferred into the production environment.

This post is really meant to cover the concept and importance of using a test environment. To what degree and exactly how to set up an efficient test environment may vary.






No comments:

Post a Comment