multiple command toolbar button
Hi,
Is it possible to create a toolbar button sequencing multiple commands?
I want to purge and audit a drawing with the click of a button. ( or shortkey )
I tried to create a button with command line
(command “purge” ”all” “enter” “No” “_purge” “-purge” ”all” “enter” “No” “-purge” “audit” “yes” “_audit”)
but I get a nil notice.
help anyone? or better suggestions?
Comments
-
Hi Bart
It is easy to test by simply entering the commands by typing them. In that case you see
purge
twice ;-) (... “_purge” “-purge” ...). You probably want something like:(command "_purge" "_All" "*" "_No" "" "_All" "*" "_No" "_audit" "_Yes")
Unfortunately, BricsCAD cannot purge recursive (which can be considered a bug), so repeat
"" "_All" "*" "_No"
as often is required.""
means enter, repeating the last command in this case, you may also type"_purge"
instead.Prepending with
(command nil)
is a way to kill active commands.Getting
nil
on the command-line is not an error, it is just to notify you that there is "no" message,nil
is evauated. If you think it is ugly, append(princ)
at the end.Try to avoid typo quotes, just straight quotes. Use an editor like notepad++ to keep you out of trouble.
_
means that international versions of BricsCAD understand your code too, not mandatory.Have fun!
0 -
Bart,
Thank you for the question, prompted me to check my Purge routine for errors before posting, found where GripBlock was being set to Off. Turns out I was turning in off every time I purged a dwg. In Acad, 0=On, but in Bcad 1=On. Fixed it in the attached QA.lsp routine (named such because Q & A are close together for lazy keyboarders such as myself).
The lisp routine purges multiple times to cover the recursive issue (All Names, RegApps, Zero-Length Geometry, Empty Text Objects) & does a few other things I personally have a liking for beyond just purging, they can be rem'd out if desired:
"Filedia" = off,
"GripBlock" = on,
"-Layer" = misc. settings,
"Zoom" = Extent,
"PROPERTIESCLOSE",
"Audit" = Yes,
Hope this is a good starting point for you.
Mike0