Running program from comand line

Running program from comand line

Anonymous
Not applicable
254 Views
4 Replies
Message 1 of 5

Running program from comand line

Anonymous
Not applicable
Hello,
I have embeded a project into a drawing and now i want to be able to start
the program from a simple command line promt.
Is this possible and how?
Thanks
--
Thomas Tavrides
Machine Designer
Century Design Company

(708) 598-4111 x114
0 Likes
255 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Make sure you have the Visual Lisp Environment loaded
(vl-load-com)

To load and run the vba:

example:
;... load project acad.dvb using vl-vbaload
(vl-vbaload "c:/acsup/acad2000/acad.dvb")

;run module or macro defined in acad.dvb
(vl-vbarun "NetSetup")
0 Likes
Message 3 of 5

Anonymous
Not applicable
Tom, I have not tried this on an embeded project but this is what I do. In my Acad2000.lsp file I add this
(defun c:your_cmd ()
(command "-vbarun" "your_macro") (princ))
Once autocad is started just type what you named your command, should work. I have to make sure my macro is loaded but you shouldn't cause it is embeded.
0 Likes
Message 4 of 5

Anonymous
Not applicable
Since you have your project embedded in a drawing, the project is loaded
when the drawing is opened. At the command line type,

-vbarun
module1.startprog

"module1" is a standard module that has your startup subroutine called
"startprog". You can change these names to what you want.

in module1

sub startprog()
form1.show 'this will show your form
end sub

you can also set up a custom tool but and add the following to the button to
start the program.

-VBARUN module1.startprog

hope this helps you out,

Sergio DeAlbuquerque
President

Matrix Technical Services Inc.
172 N.Bicycle Path
Selden, NY 11784

Ph: 631-736-9001
Fax: 631-696-8538

http://www.matrixengg.com
sdealbuquerq@matrixengg.com
"CAD services, machine design, and VBA application development"
0 Likes
Message 5 of 5

Anonymous
Not applicable
I've had some probs running macros from acad2000.lsp with the vbarun
command. They are un-predictable, occur randomly, and seem to be related
to -vbarun itself. Upon suggestion I'm using vbastmt instead and it seems to
work (for whatever reason!). Just thought I'd mention it.

Jake

jr wrote in message
news:ef36d74.1@WebX.SaUCah8kaAW...
Tom, I have not tried this on an embeded project but this is what I do. In
my Acad2000.lsp file I add this
(defun c:your_cmd ()
(command "-vbarun" "your_macro") (princ))
Once autocad is started just type what you named your command, should work.
I have to make sure my macro is loaded but you shouldn't cause it is
embeded.
0 Likes