Author Topic: Run Action Macro Automatically in specific drawing files  (Read 1374 times)

0 Members and 1 Guest are viewing this topic.

ROBBO

  • Bull Frog
  • Posts: 217
Run Action Macro Automatically in specific drawing files
« on: June 26, 2015, 04:31:14 AM »
Hello,

How could I run an Action Macro automatically on opening a particular set of drawing files. For example dwg files prefixed with B902?

Any help as always would be very much appreciated.

Kr. Robbo.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

kpblc

  • Bull Frog
  • Posts: 396
Re: Run Action Macro Automatically in specific drawing files
« Reply #1 on: June 26, 2015, 05:33:33 AM »
If your code seems like
Code - Auto/Visual Lisp: [Select]
  1. (defun test()
  2. ; ...
  3. )
Then change it to:
Code - Auto/Visual Lisp: [Select]
  1. (defun test()
  2. ; ...
  3. )
  4. (if (wcmatch (strcase (getvar "dwgname")) "B902*") (test))
Sorry for my English.

ROBBO

  • Bull Frog
  • Posts: 217
Re: Run Action Macro Automatically in specific drawing files
« Reply #2 on: June 26, 2015, 06:16:07 AM »
Thank you kpblc
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)