compatibility Lisp acad vs Bcad
@ Torsten Moses
My congratulations for your work on the Blade Lisp development.
This code runs really at an amazing speed and even offers much more possibilities.
I've been developing in Lisp on AutoCAD since 1985 (!) following Vital Lisp, then Visual Lisp when integrated by Autodesk.
We created over these years a program for the design of steel structures with over 25 000 lines of CONDENSED code.
There is only one minor comment on your approach: the function 'beautify'. This function really messes up my code and expands it so much that I've got no more overview on a high-resolution full screen.
But, apart from this, everything else is great.
To make my code running as well in AutoCAD as in BricsCAD, I had to enter these global variables in the beginning of the code:
(setq *bc* (if (wcmatch (strcase (getvar "acadver")) "*BRICSCAD*") 1 nil)
*ac* (if (wcmatch (strcase (getvar "acadver")) "*LMS TECH*") 1 nil))
In the code itself, there are a few differences between AutoCAD and BricsCAD that I solved as follows:
(command-s "_UCS" (if *bc* "_e" "_ob") (handent (car (entsel))))
(command-s (if *bc* "_layout" "_-layout") "_S" "MODEL")
(if (and *bc* (= 2 (3dS_vimport "pickadd"))) (3dS_vexport "pickadd" 1))
(cond (*ac* (command-s "_3Dorbit")) (*bc* (command-s "_rtrot")))
Because the poor possibilities in AutoCAD for the .dcl files, we use vb.net for all dialog boxes:
(cond (*bc* (command-s "_netload" (strcat 3dSloc "dddS_BC")))
(*ac* (command-s "_netload" (strcat 3dSloc "dddS_AC"))))
Finally, I see no difference in speed for BricsCAD if I use the compiled .DES file instead of the .LSP file.
Only in AutoCAD the .VLX file runs much faster.
Have you got any suggestion here?
Thanks, Jef Joris, 3+
My congratulations for your work on the Blade Lisp development.
This code runs really at an amazing speed and even offers much more possibilities.
I've been developing in Lisp on AutoCAD since 1985 (!) following Vital Lisp, then Visual Lisp when integrated by Autodesk.
We created over these years a program for the design of steel structures with over 25 000 lines of CONDENSED code.
There is only one minor comment on your approach: the function 'beautify'. This function really messes up my code and expands it so much that I've got no more overview on a high-resolution full screen.
But, apart from this, everything else is great.
To make my code running as well in AutoCAD as in BricsCAD, I had to enter these global variables in the beginning of the code:
(setq *bc* (if (wcmatch (strcase (getvar "acadver")) "*BRICSCAD*") 1 nil)
*ac* (if (wcmatch (strcase (getvar "acadver")) "*LMS TECH*") 1 nil))
In the code itself, there are a few differences between AutoCAD and BricsCAD that I solved as follows:
(command-s "_UCS" (if *bc* "_e" "_ob") (handent (car (entsel))))
(command-s (if *bc* "_layout" "_-layout") "_S" "MODEL")
(if (and *bc* (= 2 (3dS_vimport "pickadd"))) (3dS_vexport "pickadd" 1))
(cond (*ac* (command-s "_3Dorbit")) (*bc* (command-s "_rtrot")))
Because the poor possibilities in AutoCAD for the .dcl files, we use vb.net for all dialog boxes:
(cond (*bc* (command-s "_netload" (strcat 3dSloc "dddS_BC")))
(*ac* (command-s "_netload" (strcat 3dSloc "dddS_AC"))))
Finally, I see no difference in speed for BricsCAD if I use the compiled .DES file instead of the .LSP file.
Only in AutoCAD the .VLX file runs much faster.
Have you got any suggestion here?
Thanks, Jef Joris, 3+
0
Comments
-
Dear Jef,
many thanks for your kind words :-)
Yes, "Beautify" (Reformat) is a question of personal taste ... and if you use your condensed (compact) code style, then it is most likely that BLADE's style-by-design will not match :-)
Some hints :
DES file is not a true compilation, but an encryption ... while FAS/VLX are a kind on "P-Code", half-way-compiled, which makes FAS/VLX somewhat faster in AutoCAD, while the encrypted code runs at identical performance in BricsCAD
> (command-s "_UCS" (if *bc* "_e" "_ob") (handent (car (entsel))))
this can be unified :-) both CAD systems allow "_object" and "_entity" for UCS command, just 1 of these 2 options is "undocumented"
For general performance improvements :
our Lisp has (vle-start-transaction) and (vle-end-transaction), which can be placed around heavy database operations
(if vle-start-transaction (vle-start-transaction))
:
(if vle-end-transaction (vle-end-transaction))
can be nested, uses internal open/close counters;
and for safety, our Lisp engine automatically finishes all pending transactions (i.e. in case of Lisp errors, asymmetric exit etc.)
Besides, in our "Lisp Developer Support Package", (LDSP) there is also a chapter on performance, ...
besides, our Lisp also provides a VLE function library which are native functions, and for other CAD systems an emulation as vle-extension.lsp is provided
(loading vle-extension.lsp under BricsCAD does nothing);
VLE library is also documented in LDSP.
many greetings !0 -
Thanks a lot, Torsten (or is Mozes your given name?)
I'll adapt our code according your comments.
Have a nice day, Jef Joris, 3+0 -
Dear Jef,
of course, any feedback welcome (not only for BLADE) ... and performance of our Lisp engine is always at high(est) priority :-)
Btw., the LDSP package also has a Lisp benchmark, which runs on any AutoLISP compatible platform ...
and you can even drag & drop a single .lsp benchmark file into the CAD system, and use C:RUN to run it ...
interesting results :-)
Moses is my family name ... though atheist :-)
many greetings !
P.S. interestingly, there is another "Jef Joris" from Netherlands, author/owner of Parabuild ...0 -
Torsten,
In fact, Jef Joris from Parabuild is my youngest son.
He and my elder son Rudy took over my company (called "CAD Systems" at that time) after I divorced from their mother. The steel structure application I developed at that time was called S3d, they changed the name to Parabuild.
The first versions of S3d were written in Lisp, but with the help of my daughter Wendy the base was converted to arx for speed reasons. Anyway, after my experience with Blade I see no advantages for arx any more.
And you even make this development available for 'other' cad programs!
Awesome, man. You're the best by far!
All the best, Jef Joris, 3+0 -
Dear Jef,
aaaaaah - now the things get clear :-) Nice to know all the "Joris" family now (your sons & daughter, and you as well)
> The first versions of S3d were written in Lisp, but with the help of my daughter Wendy the base was converted to arx for speed reasons. Anyway, after my experience with Blade I see no advantages for arx any more.
Still there are lot of things that are faster in ARX/BRX, naturally ... and some functionality (custom entities, overrules, ...) are not possible via Lisp ...
though VLE library tries to "publish" the performance of our Lisp engine, and keeping compatibility.
There are some more improvements for our Lisp coming with V23, like "sub-entity selection + selectionsets", which allow very special + powerful entity manipulations via Lisp (like deforming an ACIS entity !); but such special things are then not available for AutoCAD + similar.
Will be in LDSP with V23 then
wish you a nice day, many greetings & thanks for your kind feedback !
0