+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Full Member
    Using
    Civil 3D 2012
    Join Date
    Jan 2009
    Posts
    56

    Default Macro run from command line

    Registered forum members do not see this ad.

    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

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,138

    Default

    Wouldn't you have to tell AutoCAD where to find the macro? Something along the lines of -vbarun"C:\Macros\mycustom_macro".
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  3. #3
    Forum Newbie
    Using
    AutoCAD 2010
    Join Date
    Jun 2009
    Posts
    4

    Default

    defun it to Lisp Command

    (vl-load-com)
    (defun c:ttx() (vla-runmacro (vlax-get-acad-object) "D:\Project.dvb!ThisDrawing.tt"))

  4. #4
    Full Member
    Using
    Civil 3D 2012
    Join Date
    Jan 2009
    Posts
    56

    Default

    Quote Originally Posted by ReMark View Post
    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.?

  5. #5
    Forum Deity NBC's Avatar
    Using
    AutoCAD 2009
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Posts
    2,109

    Default

    I use the following syntax
    Code:
    -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.
    Life's constantly changing - keep up or get left behind

  6. #6
    Full Member
    Using
    Civil 3D 2012
    Join Date
    Jan 2009
    Posts
    56

    Default

    Quote Originally Posted by NBC View Post
    I use the following syntax
    Code:
    -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 :
    HTML Code:
    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?

  7. #7
    Forum Deity NBC's Avatar
    Using
    AutoCAD 2009
    Join Date
    Aug 2007
    Location
    Manchester, UK
    Posts
    2,109

    Default

    Quote Originally Posted by iztok13 View Post
    ok i tried i have acad 2009 map:
    my file is located on :
    HTML Code:
    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 /
    Life's constantly changing - keep up or get left behind

  8. #8
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    XP Pro
    Computer:
    Dell
    CPU:
    Intel Xeon 2.13GHz
    RAM:
    2GB
    Graphics:
    NVIDA Quadro FX 580
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,070

    Default

    I have my routines in the ACAD.DVB file, and in that is a short module like this.....

    Code:
    Public Sub Cloud()
    Set myObject = New frm_Cloud
    myObject.Show
    Set myObject = Nothing
    End Sub
    then on my button I use this syntax
    Code:
    ^C^Cvbastmt;cloud;
    and all the code is embeded in frm_Cloud
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson

    Dave

  9. #9
    Full Member
    Using
    Civil 3D 2012
    Join Date
    Jan 2009
    Posts
    56

    Wink

    Registered forum members do not see this ad.

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


Similar Threads

  1. Macro to Command - Revived
    By eric_monceaux in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 23rd Jan 2009, 04:33 pm
  2. run macro from command line
    By comcu in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 27th Nov 2008, 12:28 am
  3. Macro to Command
    By eric_monceaux in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 3rd Sep 2008, 05:12 pm
  4. MACRO COMMAND
    By steel_dragon in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 13th Jul 2006, 10:12 am
  5. Macro Command?
    By skipper in forum AutoCAD Beginners' Area
    Replies: 15
    Last Post: 28th Nov 2005, 03:37 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts