Andresig Posted September 16, 2010 Posted September 16, 2010 Hi, I need to create a command where you type MP in the command line and this will call the VBA macro "MakeP". how you make this in Autolisp? Quote
Tharwat Posted September 16, 2010 Posted September 16, 2010 I guess the command name is called : -vbarun (defun c:mp () (command "-vbarun") ) But this is not a recommend way.although you can use the (acad.pgp) to change command abbreviations as best as you want. Tharwat Quote
rkmcswain Posted September 16, 2010 Posted September 16, 2010 Hi,I need to create a command where you type MP in the command line and this will call the VBA macro "MakeP". how you make this in Autolisp? Take a look at http://www.afralisp.net/visual-lisp/tutorials/loading-vba-files.php Quote
BlackBox Posted September 16, 2010 Posted September 16, 2010 But this is not a recommend way.although you can use the (acad.pgp) to change command abbreviations as best as you want. If writing a full defun, I would suggest adding a load statement within ACADDOC.lsp. :wink: I do not use VBA often, but I believe this is the correct syntax to load and execute the command (please correct me where I am wrong): (defun c:MP () (if (not [color=black]MakeP[/color]) (command "._vbaload" "[color=red]vbaCommand[/color].dvb")) (command "._-vbarun" "MakeP") (princ)) Quote
Tharwat Posted September 16, 2010 Posted September 16, 2010 If writing a full defun, I would suggest adding a load statement within ACADDOC.lsp. :wink: I do not use VBA often, but I believe this is the correct syntax to load and execute the command (please correct me where I am wrong): Absolutely Correct. Actually I couldn't try it, because in Autocad version 2010 is not supported anymore. Thanks a lot. Tharwat Quote
Andresig Posted September 16, 2010 Author Posted September 16, 2010 Thank you all for the solution. Works fine. The vba is still supported by AutoCAD 2010, but you need to download tha application from Aotudesk web page Quote
Tharwat Posted September 16, 2010 Posted September 16, 2010 Thank you for the favor back. Best regards Tharwat 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.