Jump to content

Recommended Posts

Posted

Hi all (AutoCad 2007)

 

I am trying to run VBA code from the command line by using just CTAG as the name. In searching the net seems like I need a small lisp function.

 

I dug up this code off of the net and put it in the acad2007.lsp file

 

Defun C:CTAG() 
(vl-vbarun "C:\\TestProject.dvb!Blocks.InsertBlockS") 
) 

While it sort of works... It runs my program on startup but I don't want that, I just want it to run when I use the command line and type CTAG. But when I do this it says it cannot find the command. hhhmmmm....

 

I think I am close but what am I doing wrong?

 

Thanks all!

Posted

I know very little about VBA, but could it be that you missed the first parenthesis?

 

[b][color=Red]([/color][/b]Defun C:CTAG() 
(vl-vbarun "C:\\TestProject.dvb!Blocks.InsertBlockS") 
)

Posted

thanks!!! Yep, as simple as a missing parenthesis!!!!

Posted

that's a relief! I also go over w/ those dilemmas...

careless;P

Posted
thanks!!! Yep, as simple as a missing parenthesis!!!!

 

I'm assuming from a missed parenthesis mistake that you don't use the Visual LISP Editor in ACAD to create your LISP files - if not, I would definitely recommend it, just type VLIDE at the command line. Debugging options there as well.

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