Results 1 to 10 of 12

Thread: TIP: VBA command wrappers for lisp

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,659
    Login to Give a bone
    0

    Default TIP: VBA command wrappers for lisp

    I have a menu which includes providing wrapper functions for many vba routines. The attached code is not a complete lisp function, but a portion of an mnl that automates creating "C:" style defuns for my vba routines. When I add a new vba sub, all I have to do is add the text name to an array.

    The mnl uses (vl-vbaload) to load the dvb containing the subs. The RunMacro method is used rather than (vla-runmacro) because many of my subs make use of the PickfirstSelectionSet, which gets cleared when called from lisp. You can change the consctuctor to utilize vbarun if you wish. The main point here is to minimize maintenance so as not to have dozens of defun's.
    Attached Files Attached Files
    C:> ED WORKING....

  2. #2
    Member
    Join Date
    2015-08
    Posts
    16
    Login to Give a bone
    0

    Default Re: TIP: VBA command wrappers for lisp

    sweet! Great tip.

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,659
    Login to Give a bone
    0

    Default Re: TIP: VBA command wrappers for lisp

    Thank you.
    C:> ED WORKING....

  4. #4
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: TIP: VBA command wrappers for lisp

    Quote Originally Posted by brett.burling
    sweet! Great tip.
    Agreed, very nice one

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  5. #5
    Member
    Join Date
    2015-08
    Posts
    16
    Login to Give a bone
    0

    Default Re: TIP: VBA command wrappers for lisp

    Just got upgraded to AutoCAD 2008 and the "wrapper" doesn't seem to work anymore. Anyone else had troubles??

  6. #6
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,659
    Login to Give a bone
    0

    Default Re: TIP: VBA command wrappers for lisp

    Quote Originally Posted by brett.burling
    Just got upgraded to AutoCAD 2008 and the "wrapper" doesn't seem to work anymore. Anyone else had troubles??
    There's nothing in there that should be specific to a version. Check your installation, i.e. support paths, cui, etc. Make sure everythings getting loaded properly.
    C:> ED WORKING....

  7. #7
    Member
    Join Date
    2015-08
    Posts
    16
    Login to Give a bone
    0

    Default Re: TIP: VBA command wrappers for lisp

    Umm..

    Checked the CUI and the lisp file is definitely being loaded, still no luck.
    If i open the lisp file and change the wrapper to the"old way" of doing things....

    (defun c:BGESECTIONMARK()
    (vl-load-com)(vla-runmacro (vlax-get-acad-object) "BGESECTIONMARK")
    )

    (defun c:BGESECTIONTITLE()
    (vl-load-com)(vla-runmacro (vlax-get-acad-object) "BGESECTIONTITLE")
    )
    It works fine. My wrapper code is attached...
    Attached Files Attached Files

Similar Threads

  1. Replies: 3
    Last Post: 2009-10-22, 10:19 PM
  2. Mtext Command in Lisp
    By bowtle in forum AutoLISP
    Replies: 12
    Last Post: 2009-01-12, 05:47 PM
  3. TableStyle command in lisp
    By am4soft in forum AutoLISP
    Replies: 6
    Last Post: 2009-01-11, 02:28 PM
  4. torient command in lisp
    By mbergink in forum AutoLISP
    Replies: 3
    Last Post: 2008-12-24, 04:15 AM
  5. Help starting a LISP command
    By gurudas.ku in forum AutoLISP
    Replies: 5
    Last Post: 2006-12-15, 05:00 AM

Posting Permissions

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