http://www.lt-extender.com/LT-Extender/englisch/inhalte/DEScoder/DESCoder.htm wrote:Remarks :
All source Lisp files will be merged into a single Lisp file, using the displayed order, and then included in target *.des "container" file - as result, the Lisp code from the files is loaded in exactly that sequence. Therefore, that order can effect the Lisp code in its functionality !
If you merge the two lisp files from my sample BC_Compile_Sample_2.zip in this order:
BC_Compile_Sample.lsp (the ODCL project)
BC_Compile_Sample_Functions.lsp
This code from BC_Compile_Sample_Functions.lsp will no longer work:
(dcl_Project_Import (load "BC_Compile_Sample"))
However, if you flip the order of the lisp files and save the file to "BC_Compile_Sample.des", the code will theoretically still work if the des file is found in the search path of the CAD-program. But, for obvious reasons, that would be a bad idea.
Your approach works because ODCL is flexible about the format of the text file and does have the advantage of only two files. But you do have to change the extension of the ODCL project file from .lsp to .txt every time you want to compile.
I am still in favour of the base64 text file approach. As mentioned, I have automated the process of creating a des file. All I have to do is drag-and-drop a 'special' lisp file onto a drawing. Something like this will work:
; ...
; ...
(load Create_Base64.lsp)
(Create_Base64
"D:\\LispProjects\\BC_Compile_Sample\\BC_Compile_Sample.odcl"
"MYPASS"
"D:\\LispProjects\\BC_Compile_Sample\\BC_Compile_Sample_Base64.txt"
)
(startapp
(strcat
"C:\\Program Files\\Bricsys\\Bricscad V" (itoa (atoi (getvar '_vernum))) "\\DESCoder.exe "
"D:\\LispProjects\\BC_Compile_Sample\\BC_Compile_Sample.prv"
)
)
(princ)
Create_Base64.lsp (slightly improved version):
(princ "\nLoading... ")
(setvar 'cmdecho 0)
(command "OPENDCL")
(setvar 'cmdecho 1)
; project - ODCL file with full path as string.
; password - Password as string.
; file - Text file with full path as string.
(defun Create_Base64 (project password file)
(setq project (dcl_Project_Load project T))
(setq file (open file "w"))
(write-line (dcl_Project_Export project password) file)
(close file)
(princ)
)