iztok13 Posted September 9, 2009 Posted September 9, 2009 Hello there , I was searching all over the forum but i didnt find, how tu run load macro from command line automaticly. if i use : -vbarun ask me for a name of macro when i tiped in its all Ok then RUn my macro. but how can i use -vbarun in one line because i want to have shortcut in my button. itried;: -vbarun;macro_name didnt work i hope u understend my problem. I want to tipe command that execute macro in on line in command line. My macro it loaded in stratup suit. thx Quote
ReMark Posted September 9, 2009 Posted September 9, 2009 Wouldn't you have to tell AutoCAD where to find the macro? Something along the lines of -vbarun"C:\Macros\mycustom_macro". Quote
xsfhlzh Posted September 10, 2009 Posted September 10, 2009 defun it to Lisp Command (vl-load-com) (defun c:ttx() (vla-runmacro (vlax-get-acad-object) "D:\Project.dvb!ThisDrawing.tt")) Quote
iztok13 Posted September 10, 2009 Author Posted September 10, 2009 Wouldn't you have to tell AutoCAD where to find the macro? Something along the lines of -vbarun"C:\Macros\mycustom_macro". no this dont work, i tried . i cant belive that its no simple solution in command line.? Quote
NBC Posted September 10, 2009 Posted September 10, 2009 I use the following syntax -vbaload;"C:/AutoCAD/VBA/filename.dvb;-vbarun;"C:/AutoCAD/VBA/filename.dvb!macroname" I must note, however; that I put the above into a script file; and then create a toolbar button to open the script file. Quote
iztok13 Posted September 10, 2009 Author Posted September 10, 2009 I use the following syntax -vbaload;"C:/AutoCAD/VBA/filename.dvb;-vbarun;"C:/AutoCAD/VBA/filename.dvb!macroname" I must note, however; that I put the above into a script file; and then create a toolbar button to open the script file. ok i tried i have acad 2009 map: my file is located on : C:\Program Files\AutoCAD Map 3D 2009\Iztok nastavitve\IzrNiv.dvb and i do this shortcut but dont work: -vbaload;"C:\Program Files\AutoCAD Map 3D 2009\Iztok nastavitve\IzrNiv.dvb;-vbarun;"C:\Program Files\AutoCAD Map 3D 2009\Iztok nastavitve\IzrNiv.dvb!izrniv" macro is run with "izrniv" where have i misted? Quote
NBC Posted September 10, 2009 Posted September 10, 2009 ok i tried i have acad 2009 map:my file is located on : C:\Program Files\AutoCAD Map 3D 2009\Iztok nastavitve\IzrNiv.dvb and i do this shortcut but dont work: -vbaload;"C:\Program Files\AutoCAD Map 3D 2009\Iztok nastavitve\IzrNiv.dvb;-vbarun;"C:\Program Files\AutoCAD Map 3D 2009\Iztok nastavitve\IzrNiv.dvb!izrniv" where have i misted? Try changing the direction of the slashes e.g. from \ to / Quote
dbroada Posted September 10, 2009 Posted September 10, 2009 I have my routines in the ACAD.DVB file, and in that is a short module like this..... Public Sub Cloud() Set myObject = New frm_Cloud myObject.Show Set myObject = Nothing End Sub then on my button I use this syntax ^C^Cvbastmt;cloud; and all the code is embeded in frm_Cloud Quote
iztok13 Posted September 10, 2009 Author Posted September 10, 2009 Try changing the direction of the slashes e.g. from \ to / Thank u very much, i cant belive this actually works. I change direction of slash & works perfect, I new that is a simple solution for this. thx to every one. :wink: Quote
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.