On Fri, 5 Feb 2010 09:27:03 -0800, Jason Piercey wrote:
>I see folks, ones which I respect their coding ability a great deal,
>posting code with these shortcuts defined in the LISP file. It's
>simply bad practice to do so, IMO.
It's not "bad practice" at all. Smaller LISP symbol names take up less memory
and system resources than overly long ones, and you don't have to define
shortcuts for them in the PGP file.
This also relieves you of having people needing to coordinate their own PGP file
with your macros as you update things.
IMO, in most cases people who write "global" LISP routines and functions do so
to provide users with a list of shortcuts for complex command macros that are
simply impossible using the PGP, due to its inherent limitations. People can
infill the PGP with shortcuts on their own which do not interfere with the
master global list.
When you want to give your users the chance to change the command macro used,
you have a couple of choices, including your method. But to me, it's
easier/better IMO to write a function that allows users to redefine your LISP
routines to a new shortcut symbol, remove your old symbol from memory, and use
their own PGP shortcuts.
For example, in a user's .lsp file, which could be set to load in each
drawing, you can do something like this:
;; Redefine standard LSP command macros
;; Usage:
;; (ReDefineMattsCommand C:MattsCommandName C:YourCommandName)
(ReDefineMattsCommand c:c c:co) ;; redefines my global "Copy" macro to "CO"
Then in their ACAD.PGP, the user would have this:
C *COLOR
Matt
matt@stachoni.com