gdanielo Posted September 19, 2024 Posted September 19, 2024 (edited) Hello everyone, I create VBA macros and I'd like to know if there's any way to create new command as lisp. ex.: (defun c:new-command()) If so, can "drop down menu" like other natives commands (see picture below) be created ? If not, do I need to create a lisp program to create commands only ? does this lisp program can create those options (as picture below) ? Edited September 19, 2024 by gdanielo Quote
BIGAL Posted September 20, 2024 Posted September 20, 2024 In VBA you make Sub routines so these can be called from within the master VBA program. The VBA program would use say a Form for selection. I dabble at the edges of VBA need to open a 15 year old VBA I have to see how I did it. Quote
pkenewell Posted October 18, 2024 Posted October 18, 2024 You can create an AutoLISP command wrapper to run your VBA Macro. Try this example to create AutoCAD commands: (defun c:MyCommand (/ fil mac) ;; Replace "MyCommand" with the command name of your preference. (vl-load-com) (setq fil "myfile.dvb" ;; Replace with the name of your DVB file mac "MyMacroSub" ;; Replace with the name of your main sub to fun the program. ) (vl-vbarun (strcat fil "!" mac)) (princ) ) Quote
BIGAL Posted October 18, 2024 Posted October 18, 2024 Another example this is a line in a POP menu. [Drainage schedule]^C^C(vl-vbaload "P:/AutoDESK/VBA/Drainage.dvb") (vl-vbarun "Drainage") 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.