Results 1 to 10 of 10

Thread: User form Call routine

  1. #1
    Join Date
    Mar 2004
    Location
    Latvia
    Posts
    14

    User form Call routine

    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.

  2. #2
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    357
    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

  3. #3
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    856
    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.

  4. #4
    Join Date
    Mar 2004
    Location
    Latvia
    Posts
    14
    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"?

  5. #5
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    357

    ....

    Quote Originally Posted by geniegb
    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]

  6. #6
    Join Date
    Mar 2004
    Location
    Latvia
    Posts
    14
    Shame on me, respect to YosSa.

  7. #7
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    357

    ...

    It works right now ???

    Wanna know my bank account ??

    :P :P :P :P

  8. #8
    Join Date
    Mar 2004
    Location
    Latvia
    Posts
    14
    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.

  9. #9
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    357
    Quote Originally Posted by geniegb
    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() ???

  10. #10
    Join Date
    Oct 2012
    Posts
    1
    Hi,

    I am a new user and after reading above thread

    i have few question as follows

    can i load autolisp routine from vb user form and if yes how should i do it?

    how to load autocad app with new drawing loaded in autocad using vb?

    how do i transfer the variables values between VB and autolisp and back to VB?

    and is coding secured in autolisp and in VB?

    Regards
    Sunny

Posting Permissions

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