load and start by icon

Discussion in 'AutoCAD' started by Jan Tappenbeck, Jul 23, 2003.

  1. how can i load and start a vba project by toolbar or pull-down ????

    regards Jan :)
     
    Jan Tappenbeck, Jul 23, 2003
    #1
  2. Jan Tappenbeck

    Tim Riley Guest

    -vbarun c:/filepath/custom.dvb!modulename.subroutinename
     
    Tim Riley, Jul 23, 2003
    #2
  3. Hi Jan,

    There is a bit of work setting this up in that you need an install routine
    to write the installation directory to the registry and you need to create
    an MNL file, but it works very well for me. The defined functions can be
    readily added to menu files either on an icon or pop menu.

    The advantages are that:
    the command line only echoes the command
    you can repeat the command by pressing enter
    you can type the command directly at the command line.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au


    Extracts from AustSupp.MNL

    ;//
    ;// AutoCAD menu file - AustSupp.mnl
    ;//

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Get the install paths from the registry ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;; Set the path to the programs by reading it from the registry.
    (setq AustSuppVBAPath
    (strcat
    (vl-registry-read
    "HKEY_LOCAL_MACHINE\\Software\\CADApps\\AustSuppPrograms\\" "VBA Program
    Path")
    "\\"
    )
    )

    (setq AustSuppLispPath
    (strcat
    (vl-registry-read
    "HKEY_LOCAL_MACHINE\\Software\\CADApps\\AustSuppPrograms\\" "Lisp Program
    Path")
    "\\"
    )
    )

    (defun CADApps_BlankCommandLine (spString)
    (setq n (strlen spString))
    (repeat n(prompt(chr 8)))
    (repeat n(prompt(chr 32)))
    (princ)
    ) ; CADApps_BlankCommandLine

    (defun C:AustSuppHelp ()
    (setq strAustSuppHelp
    (Strcat
    (vl-registry-read
    "HKEY_LOCAL_MACHINE\\Software\\CADApps\\AustSuppPrograms\\" "Help Path")
    "\\index.htm"
    )
    )
    (COMMAND "_BROWSE" strAustSuppHelp )
    ) ; end Defun AustSuppHelp
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; General drafting ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (defun C:Drawline ()
    (setq ASProgName (strcat AustSuppVBAPath
    "CADApps_drawlineU3.dvb!Drawline"))
    (vl-vbarun ASProgName)
    (CADApps_BlankCommandLine ASProgName)
    ) ; end Defun Drawline

    .........................
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; Earthworks tools ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (defun C:LEC_3df_3dl ()
    (setq ASProgName (strcat AustSuppLispPath "LEC_3df_3dl.lsp"))
    (load ASProgName)
    (LEC_3df_3dl)
    ) ;; end LEC_3df_3dl


    (defun C:LEC_Bal_Ew ()
    (setq ASProgName (strcat AustSuppLispPath "LEC_Bal_Ew.lsp"))
    (load ASProgName)
    (LEC_Bal_Ew)
    ) ;; end LEC_Bal_Ew

    .................................... etc
     
    Laurie Comerford, Jul 23, 2003
    #3
  4. Jan Tappenbeck

    Jason Wilder Guest

    why do you need to write to the registry?

     
    Jason Wilder, Jul 23, 2003
    #4
  5. Hi Jason,

    This is for programs which a user, through an install program, can put
    anywhere. The install program (Inno Setup based) writes the data to the
    registry and this process makes the menu files totally independent of where
    the software is installed, and also makes it unnecessary to put the install
    path on the AutoCAD path.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Jul 24, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.