Bangalore, India
All of you know very well that Bricscad supports Lisp as an API just like AutoCAD and many other CAD applications do. Running un-protected Lisp source code is easy and same as in other CAD systems. You write your <filename>.LSP program and load it using the (load ....) function or the APPLOAD command and start using it.
However, professional programmers want to go beyond just loading a handful of LSP files. Two common requirements are:
- How do you protect your Lisp source code so that others will not be able to decrypt and reverse engineer it?
- How do you package multiple LSP files neatly into one single executable file, like the Visual Lisp VLX files in AutoCAD?
The answer to this is to use the DESCoder, a small additional utility that was created by Torsten Moses of Bricsys.
The DESCoder offers almost exactly the same functionality as Visual Lisp. However, there are some differences as well. Let us examine the similarites and differences.
.DES in Bricscad = .VLX in AutoCAD - both are encrypted and secure-code
The DESCoder will compile multiple LSP files, and any additional resource files like DCL, TXT etc and package them all into an executable which has the extension .DES, which is the executable format Lisp application. In Visual Lisp, the equivalent to this is the VLX file. Additionally, the DEScoder uses the same project (PRJ) and make (PRV) files that are used by the Visual Lisp compiler. So, if you have created a Visual Lisp project, you can re-use those files to parallely create a Bricscad executable application.
DESCoder is a standalone application, VLISP is within AutoCAD
While Visual Lisp is called from within AutoCAD using the VLISP command, the DESCoder is a stand-alone application that must be run independent of Bricscad. In my opinion, it does not make a difference.
No Integrated Development environment in DESCoder:
Visual Lisp has an integrated development environment (IDE) while DESCoder does not have such a thing. Which means, you cannot debug your applications using DESCoder in the manner Visual Lisp does. You need to do Lisp debugging in the traditonal way by loading the Lisp in Bricscad and see how it runs. Most Lisp programmers are old-guard programmers like me and seldom use the IDE. But, if you are used to the IDE, this is something you might miss in Bricscad. Unfortunately, Bricsys has no plans for an IDE for Bricscad. The only time I find Visual Lisp IDE useful is to check for memory leaks - for any variables that have been inadvertently left global.
No separate namespace in DESCoder:
Another limitation of DESCoder-compiled applications is that they cannot run in a separate namespace like VLX files do. What this means is :: if you have two applications, A and B compiled into DES, and if they have a same Lisp variable defined in each of them, it will be visible to the other application and this can potentially be a problem and cause variable-names conflict. The application which loads second will overwrite the same variable defined by the previously loaded application. If you are developing Lisp applications for Bricscad, you must be aware of this limitation. In AutoCAD VLX executables, this is not a problem since they can run in their own namespace and are not visible to the other application. For example, we are now splitting our GeoTools into two products - GeoTools and CADPower. Each application would have a Lisp variable called #ProductName which would be set to "GeoTools" and "CADPower" in their respective codes. Now, if you load both them of them together in Bricscad one after the other, the variable #ProductName will have the value derived from the last loaded of the two applications. The workaround is to ensure that the variable names are unique as there is only one namespace where it is loaded, so we would use #ProductName_GT and #ProductName_CP in the respective codes.
Using DESCoder
Using DESCoder is easy. Once you download it from here, install and run it, you will see an interface which looks like this. There is only one screen to deal with. The two main components you see are a tabbed selection named DES File and DES Project. As the name suggests, the former is used to compile a single LSP into a single DES file. The latter is used to define a compile-project of multiple LSP files and compile them all into one single DES file. The various buttons display tool-tip help as you hover on top of them. You can directly open Visual Lisp PRV files as described in this post. This is perhaps the easiest way to get started while you play around more with it. Feel free to contact me for more help and support.
You can also reach the creator of this utility at the following address:
TM-CAD Engineering
Torsten Moses
Landjägerstrasse 34
12555 Berlin
Germany
Tel.: +49 30 5530620
eMail: [email protected]
Discover Bricscad, discover GeoTools-AutoCAD & GeoTools-Bricscad, discover TechCenter. Brand new ways to work smarter in CAD!!
Sir,
Is there any Tutorial for
How to compile .lsp to .des
with above said software
Posted by: Ganesh | December 17, 2016 at 11:12
My question is, I have a DESCoder.exe that's in the BricsCAD install folder in C:\Program Files. Should I use this one instead of the one you recommend for download?
Posted by: Jorge Terrazas | May 23, 2019 at 18:53
Hello Jorge,
I think you can safely use the one which is in your install folder.
That would be one of the newest builds of DEScoder if you have downloaded your BricsCAD also recently.
Best Regards
Rakesh Rao
Posted by: Rakesh Rao | June 09, 2019 at 12:05