Andresig Posted September 16, 2010 Share 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 Link to comment Share on other sites More sharing options...
Tharwat Posted September 16, 2010 Share 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 Link to comment Share on other sites More sharing options...
rkmcswain Posted September 16, 2010 Share 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 Link to comment Share on other sites More sharing options...
BlackBox Posted September 16, 2010 Share 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 Link to comment Share on other sites More sharing options...
Tharwat Posted September 16, 2010 Share 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 Link to comment Share on other sites More sharing options...
BlackBox Posted September 16, 2010 Share Posted September 16, 2010 Thanks a lot. You're welcome. Quote Link to comment Share on other sites More sharing options...
Andresig Posted September 16, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
Tharwat Posted September 16, 2010 Share Posted September 16, 2010 Thank you for the favor back. Best regards Tharwat Quote Link to comment Share on other sites More sharing options...
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.