Jump to content

Create a Command to run macro from command line


Andresig

Recommended Posts

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

Link to comment
Share on other sites

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))

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...