Elektrik Posted April 3, 2022 Posted April 3, 2022 I am customizing quick access toolbar by adding some command or creating new commands, and I want to create a new command to execute a lisp. It is a speacil burst command and its short command is nb so I wrote ^C^C_bn; in its command macro in customize user interface, but I could not execute it. Thanks in advance. Quote
JerryFiedler Posted April 4, 2022 Posted April 4, 2022 Does your command nb run properly when entered in the command line? 2 Quote
tombu Posted April 4, 2022 Posted April 4, 2022 Remove the _underscore. About Special Control Characters in Command Macros https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-DDDB6E26-75E1-4643-8C6A-BEAEBA83A424 _ Translates commands and options that follow from the localized name to the global name. As bn is a command defined by lisp it wouldn't have a localized name. Assuming the lisp has been loaded in the current drawing ^C^Cbn; should work. 1 Quote
BIGAL Posted April 4, 2022 Posted April 4, 2022 (edited) ^c^c(if (not bn)(load "bnlispfile.lsp"))bn Edited April 6, 2022 by BIGAL 1 Quote
tombu Posted April 4, 2022 Posted April 4, 2022 Lots of macro options. The ^C^C cancels both current command and selection. From the link I posted above a ( )space or (;)semicolon issues enter in a macro separating actions in the macro. The or function evaluates the expressions from left to right, looking for a non-nil expression so if C:bn is already defined and returns True the next expression (load "bnlispfile.lsp") isn't evaluated (reloaded). ^C^C(or C:bn (load "bnlispfile.lsp"));bn If you wanted your lisp to work with preselected objects you would need to leave out the ^C^C. To test if there is a current command you would need to use DIESEL in the macro. For example I replaced the Ctrl+A macro in the CUI Keyboard Shortcuts → Shortcut Keys ^C^C_ai_selall which cancels any active commands (not always what you want it to do) with $M=$(if,$(getvar,cmdactive),_all,^P_ai_selall ^P) Now Ctrl+A uses the selection option _all while in an active command and _ai_selall when there isn't an active command so it selects all either way. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.