Adding LISP, VB apps, and more to Tool Palettes

image By now Tool Palettes have probably become a staple of your workspace.  We can put all sorts of things on Tool Palettes; lines and blocks being the most common.  While lines and blocks on tool palettes add a degree of sanity for many, wouldn’t it be nice if we could say add a LISP routine, VB app, even execute a script from a Tool Palette?

Well the good news is that we can, although the process isn’t necessarily obvious for many. 

  1. Create a new Line Tool: Simply draw a line in your drawing, and add it to the desired Tool Palette.

    image

  2. Adjust the Properties of your tool: Right-click on the tool, and select "Properties"

    image

  3. Define the Command: From the resulting "Tool Properties" dialog, you will want to give your tool a name and description.  Both of these can be anything you wish, as neither effects the tools function.

    What we’re most interested in is the "Command" grouping.  First you will want to disable the flyout feature by setting "Use Flyout" to "No".  Next you will want to specify the command you wish to execute.

    image

    • LISP: (LOAD "C:/LISP/sample.lsp");lisp command;
      The above code assumes my LSP file is located on my local C-drive in a LISP folder.  Do note the path mentioned in the above code is generally represented as "C:\LISP\sample.lsp".  For things to work on a Tool Palette we must reverse the slash from a "\" to a "/".

    • SCRIPT:  You can execute just about any script you want.  The trick here is the use a semicolon (;) in place of line breaks.  The final result will be a single-line script.

    • VBA: (COMMAND "-VBARUN" VBAPath " ")

Donnie Gladfelter

AUGIWorld columnist, Donnie Gladfelter is jointly responsible for the technical support and training provided to the CAD staff of Timmons Group where he serves in the role of Design Systems Specialist.

Related Posts

Sponsors

What I'm Doing...

  • Just finished watching another movie at the beach; boy do we have a way of picking some depressing movies! 12 hrs ago
  • How appropriate; sitting at the shopping mall where the video for the song "waiting on a woman" was shot, and I'm waiting on Helen :) 1 day ago
  • Getting ready to go to dinner, and then it's off to the Wolf Howling at Alligator River NWR. 2 days ago
  • More updates...

Sponsors