View Full Version : User form Call routine
geniegb
13-04-2004, 11:31 AM
Hello.
I have a userform and some vba SUBs.
What is the VBA, AUTOLisp routine for loading them?
How to call them from command line, LISP program, VBA sub?
Thank you.
YosSa
13-04-2004, 12:46 PM
Make sure this is in you're acad2000doc.lsp (at the bottom)
(command "_VBAUNLOAD" "YourVBARoutine.dvb")
(command "_-vbaload" "YourVBARoutine")
From you're menu you can call the module:
-vbarun Module1.youreSUBname
Eddie
13-04-2004, 08:58 PM
8) Don't forget to place them either in the support directory or one that has a support path set in the options.
As for LISP..type APPLOAD into the command prompt, in the dialog that pops up locate the lisp routine you wish to load...alternatively in this dialog click on the STARTUP SUITE and ADD the lisp routine into here so it loads everytime you startup autocad.
This can also be achieved by adding the lisp routine to the acad2000doc.lsp...but hte lisp file need to placed in the autocad support folder for this.
geniegb
16-04-2004, 12:01 PM
thank you for this.
But still how to run a userform named "userform" stored in "c:/userform.dvb"?
It is not a macro because ALT+F8 is not showing anything in macro command column.
The only way i know is - ALT+F11, then choose forms, then "userform", then choose F5 or "Run".
And for those less educated what is "acad2000doc.lsp"?
YosSa
16-04-2004, 12:09 PM
thank you for this.
But still how to run a userform named "userform" stored in "c:/userform.dvb"?
It is not a macro because ALT+F8 is not showing anything in macro command column.
The only way i know is - ALT+F11, then choose forms, then "userform", then choose F5 or "Run".
And for those less educated what is "acad2000doc.lsp"?
Type on youre commandline: VBALOAD
Then select the userform.dvb
Now, to show youre real userform, you should make a module in the userform.dvb.
In this module, put next:
sub ShoWfoRm()
userform.Show
end sub
Now, type on youre commandline: VBARUN
Now you should see a macro called ShoWfoRm ...
This should work.
[/quote]
geniegb
16-04-2004, 12:16 PM
Shame on me, respect to YosSa.
YosSa
16-04-2004, 12:25 PM
It works right now ???
Wanna know my bank account ??
:P :P :P :P
geniegb
23-04-2004, 01:56 PM
Yes it works
in Lisp
(defun aa()
(command "vbaload" "c:/userform.dvb")
(other command)
(command "vbaunload" "c:/userform.dv")
)
this code initializes vba User form on each -aa- call.
YosSa
23-04-2004, 02:02 PM
Yes it works
in Lisp
(defun aa()
(command "vbaload" "c:/userform.dvb")
(other command)
(command "vbaunload" "c:/userform.dv")
)
this code initializes vba User form on each -aa- call.
(defun C:\aa() ???
Powered by vBulletin™ Version 4.0.3 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.