Author Topic: Write a macro to record a macro  (Read 14043 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
Write a macro to record a macro
« on: April 20, 2011, 08:36:21 PM »

I saw your article in Ralph Grabowski's weekly newsletter, but I don't speak 'programmer', so I only understood parts of it.  Thanks, by the way, for the article.

There are programs in the world that have modules that allow users to record actions and keystrokes, with a re-useable macro as the end product.  I believe AutoCAD R14 had such a macro recorder.  Nowadays, with Revit 2011, on the Manage tab, there is a handsome pair o' buttons presumeably designed to manage macros.  However, there appear to be no macros to manage, and no way for users to make them - there IS no macro recorder in Revit.

Is it possible to write a macro that would allow users to record a macro? I'm completely serious - we as mere mortal users have to work within temporal and financial constraints, so we don't have time to learn how to write macros in C# or .net, but we DO need to be able to automate repetitive tasks in Revit.

Any hope?  Or am I indescribably naive, considering how much this would cut into the business of programmers?

Lower Life Form (ie, non-programmer)

Offline david cruse

  • Newbie
  • *
  • Posts: 1
  • Karma: +1/-0
  • Gender: Male
    • prefered language: VB
    • Prog expertise: Good
    • View Profile
Re: Write a macro to record a macro
« Reply #1 on: January 05, 2013, 07:06:36 PM »
The easiest way to write a macro is not to write it from scratch but to let UltraEdit do most of the work for you. One of UltraEdit's trademark features is the ability to use powerful macros.

The macro menu includes a feature called quick record which can write most of your macro for you if you understand how it works. The quick record function records what you are doing until you tell it to stop.

When writing a macro, using quickrecord, the idea is to manipulate the text/data as much as possible using the keyboard, UltraEdit's native functions, Templates, and even other macros so quickrecord can record your steps. After you stop quickrecord, you can then go back and edit the macro by hand.

For instance, you can go back through your macros and add loops, conditional statments, regular expressions, etc.

We have used this method MANY times in creating very complex macros which have saved us hours and hours of work. It's just another example of the power of UltraEdit!

Lets begin...