Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro to record a macro ...

13 REPLIES 13
Reply
Message 1 of 14
plawton5092
3686 Views, 13 Replies

Macro to record a macro ...

Anyone:

 

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.  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?

 

Signed,

Lower Life Form (ie, non-programmer)

13 REPLIES 13
Message 2 of 14
tkendrick
in reply to: plawton5092

I agree with this post entirely. I hope someone out there provides a response.

----
Use this link to tell Autodesk about features you need:
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=1109794
Message 3 of 14
ollikat
in reply to: tkendrick

I'm a pure programmer so I don't have much to give for this issue 🙂

But there are these journal files. I have understood that you can think them as a recorded macro also. I think I heard at some point that you can drag the journal file over the Revit and drop it. After that Revit executes what's in the journal. But I haven't tested this my self...so could be urban legend also 🙂

Message 4 of 14
revitworkbench
in reply to: ollikat

Has anyone made a macro to record a macro in Revit in the past 3 years since this post? Any API developements in that area? Thanks,

Message 5 of 14

Recently I installed the Autodesk Revit SDK and was surprised that it does not have a record feature. Rhino, Adobe, Microsoft and others have macro recorders – AudoCAD includes an Action Recorder. Even if you have software programming skills, a recorder is a useful feature because it saves time. A few years ago, I wrote a software program that recorded and automatically wrote code for a user who executed a series of commands and features - it was for a specific software application. Afterwards, it allowed the user to edit the new macro code. I see there are several generic macro recorders on the Internet that may be the answer, but I have not tested them to verify their integration with Revit. I do not know if the code they create can be edited in Visual Studio or opened inside the Revit SharpDevelop open-source integrated development environment (IDE) inside Revit - that is if you installed the Revit Software Developer Kit (SDK). In other words, those 3rd party macro recorders may create proprietary code that is not editable, or can only be used when their software runs it. What is the status of an official Autodesk ‘REVIT Action Recorder’? Alternatively, has anyone developed Add-On software to ‘Record a Revit Macro’?
Message 6 of 14

Any updates on this topic?

Message 7 of 14
scSKA9C
in reply to: plawton5092

Keeping this thread alive, I too would find this useful.

 

I will add that the Dynamo Plugin seems to offer some hope. I found 2 results on GitHub when I searched "revit action recorder" (see below) but unfortunately I'm still such a n00b at Dynamo that it does't mean much to me yet. Don't even know how to try it out. But in case it helps:

 

https://github.com/DynamoDS/Dynamo/search?q=revit+action+recorder&unscoped_q=revit+action+recorder

Message 8 of 14

the ultimate kick in the teeth on this is that AutoCAD now has an Action Recorder. 

 

Revit? Not so much.

 

Do the product teams even talk to each other?? This is crazy.

Message 9 of 14
zach__young
in reply to: plawton5092

I would love to see development on this too. Any updates?

Message 10 of 14
sragan
in reply to: zach__young

I've thought about this before too, and I also think it would be nice.

 

I've done some programming, and even thought about trying to write a program that would do this, but I have no idea where to start.

 

The revit programming interface  (the API) just doesn't provide access to all the same commands that are available in the user interface.  So  I just don't think this is possible, and that's probably why revit hasn't included anything to do that .

 

As far as the journal files go, I've heard the same thing, but I've never been able to get any to execute anything.  And its almost impossible to find a particular command in one.

Message 11 of 14

isn't it sad that after 12 whole years this thread is still unsolved.

Message 12 of 14

I don't understand the action recorder approach to life in general. If you want to do the same thing over and over again just keep a copy of the same file and change the parts you want to change with a macro etc.

 

In AutoCad you can change variables after recording obviously but that deals with simple geometry that doesn't always need to have a relationship. I can't fathom how similar would work in Revit?

Q) We drew these slabs with 1200 radius but now we want them all to have 1250?

A) Group a slab and place it at different levels

 

Q) We placed 20 columns now we want 25? 

A) No answer, other than copying standard bays over.

 

Q) We want to change these single doors to double

A) Change the type

 

Generally you would end up with a mess at some point because the double door is wider than the single so is half imbedded into an adjoining wall.

 

Where you do see these things historically they are based on VBA macro recorder. They chose instead with Revit a long time ago to go with SharpDevelop since at the time VBE/VBA was being discontinued by MS anyway and doesn't support .Net languages. Still all these years later and VBE is still a part of MS Office. I think MS at some point realised they just could not get all those old office macros written in VBA translated to a .Net version (they didn't want to force the issue so gave up on the idea of updating/discontinuing VBE). I think around the same time VBE was being 'discontinued' Autodesk added their version of macro recorder to AutoCad and made VBE an optionally installed component to AutoCad. Also people talk of running journals but what is a Revit journal? A VBScript file with a load of comments.

 

Here is a real idea you can ask for in ideas section:

Why can't we have the same sketch linked to multiple slabs in parallel???

That would be simple right? Since you have a database record for the sketch linked to a database record for the slab. You just need to enforce a check to ensure the elements are concentric on plan. When the slabs are moved out of alignment a warning is produced and the user can choose to have the slab item assigned it's own copy of the sketch (or cancel).

Less sketches = less sketch lines = less clutter (win win).

 

Message 13 of 14

Well... not every problem can be solved as simply as you've but it, why would we ever need dynamo if it was this accessible... we use dynamo to automate repetitive tasks, but it would be a much easier approach to just record a few commands that I use daily and reuse them instead of having to learn Dynamo.
and if I take your approach, I'd say that requesting same sketch for multiple slaps is pointless... just group the slap before copying it and when u edit one slap in the group u edit them all... see you can always find a good workaround in Revit, but this doesn't necessarily mean that it can't be better or more convenient.

Message 14 of 14

Yes I agree there is obviously some thing missing between automating a simple task a general user can do and using Dynamo. Autocad is command line based so regardless of action recorder etc. it always had that ability for a user to read what they had done alter it and feed it back in. However Revit was never based on that kind of approach, probably it is something it would benefit from but I think ultimately the task is either simple where the options I outlined suffice or it is a simple task with lots of hidden complexities regarding element relationships. For the latter any scripting approach would just run into issues.

 

Take the analytical structure automation written in Dynamo, on the face of it the task is simple: extract the curves convert them to analytical model and join them. However that caters for one point in time when there is no analytical model. Therefore it has also been written to check for the existing associations and adjust them rather than creating and duplicating them. There will be no scripting type of automation that has the structure within it to allow for that. Allowing for state is the common issue with scripting and in Revit the existing state of one element can have an impact on another. 

 

I've come across slabs that are grouped and I noted that as an option above but it is a terrible option based on how groups work and how that restricts what can be done with them. It also makes no sense in terms of minimum information required in a database. Since you have group instances containing copies of the slab rather than a sketch and where the slabs associated with it exist i.e. you are adding group instances to the database that have other concerns rather than just an object to identify the position of a slab related to a slab sketch. 

 

Do the instance parameter vary between groups or not??? I grouped it for a reason I want to know the variations between groups (one group for each variation). Not 'this item is similar but this parameter on it is not'. That feature seems like a good idea (primarily for people that don't want to add another type of group) until the person that created all those secondary permutations gets run over by a bus and someone else inherits it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community