« Convex Hull and Volume Computation | Main | RVT and RFA Thumbnail Image »

June 29, 2009

Comments

Hi Jeremy.

Do you know if it is possible to catch the last command or tool used?
By the way, is it the correct place to ask you some stuff wich are most of time nothing to see with the current post?

Cheers!

Dear Pierre,

Obviously, if you can find a blog post that is related to the topic you have a question on, then that would be the best place to submit it. Otherwise, I don't mind if you post it anywhere you like.

How to catch the last command or tool used? Hmm, well, it would be nice to tap into the Revit undo stack, wouldn't it? I do have one idea that you can realistically explore a little bit: if you look at the current journal file, it will tell you all the actions that have taken place in the active session. This includes calls to tools that were executed and the elements affected. For instance, I created a new wall, moved it, and then deleted it. Afterwards, I found the following information in the journal file:

Jrn.Command "Internal" , "Create a wall , ID_OBJECTS_WALL"
Jrn.Data "Transaction Successful", "Wall - Line"

' 0: Candidates (curIdx = 0): 137774 (-10.042006, +6.541914, +3.937008)

Jrn.Data "Selection action", "REPLACE", "SEL RESULT: Walls : Basic Wall : Generic - 200mm"

' 0: Candidates (curIdx = 0): 137793-33212 (-9.539976, +10.004571, +3.937531) 137774 (-10.042006, +6.541914, +3.937008)

Jrn.Data "Control", "WallFlipControl", 1.00000000000000
Jrn.Data "Transaction Successful", "Change wall's orientation"

' 0: Candidates (curIdx = 0): 137774 (-6.810193, +6.541914, +3.937008)

Jrn.MouseMove 1 , 672 , 403
Jrn.MouseMove 1 , 671 , 346
Jrn.LButtonUp 0 , 671 , 346
Jrn.Data "Transaction Successful", "Drag"

Jrn.Command "AccelKey" , "Delete the selection , ID_BUTTON_DELETE"
Jrn.Data "Transaction Successful", "Delete Selection"

Jrn.Command "SystemMenu" , "Quit the application; prompts to save projects , ID_APP_EXIT"

As you can see, with a bit of imagination, the journal file lists the tools used as well as the element ids of objects affected, although obviously this is totally undocumented, unsupported, purely to play with at your own risk.

You can also have a look at the post

http://thebuildingcoder.typepad.com/blog/2009/02/getting-the-journal-file-path.html

Cheers, Jeremy.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource