Results 1 to 6 of 6

Thread: ViewActivated Event

  1. #1
    I could stop if I wanted to
    Join Date
    2007-02
    Location
    Alexandra, New Zealand
    Posts
    237
    Login to Give a bone
    0

    Default ViewActivated Event

    HI.

    I have this code that works perfectly when manually run through an external app or command. What is does is checks the parameters of an object and does some calculations on them and then writes revised Parameter values to that object if they require.

    I want to automatically set this to check when a view is changed in revit using the View Actiavted event handler. I have it all set up using the exact same code but it spits out an error as in the atatched Pic.

    Can anyone hepl me or suggest what I need to do?

    Cheers

    Phillip
    Attached Images Attached Images

  2. #2
    I could stop if I wanted to
    Join Date
    2007-02
    Location
    Alexandra, New Zealand
    Posts
    237
    Login to Give a bone
    0

    Default Re: ViewActivated Event

    I forgot to say that this is using Revit 2010 API. I have also tried wrapping the command in a transaction but I get the error message as attached.
    Attached Images Attached Images

  3. #3
    I could stop if I wanted to
    Join Date
    2007-02
    Location
    Alexandra, New Zealand
    Posts
    237
    Login to Give a bone
    0

    Default Re: ViewActivated Event

    Any ideas out there?

  4. #4
    Woo! Hoo! my 1st post
    Join Date
    2002-12
    Posts
    1
    Login to Give a bone
    0

    Default Re: ViewActivated Event

    have you found a solution?
    I am hoping to use an application level macro to do a similar task.

  5. #5
    Active Member
    Join Date
    2008-02
    Posts
    58
    Login to Give a bone
    0

    Default Re: ViewActivated Event

    It seems transactions are temporarily disabled, the question is why. I would presume either another transaction is in progress, or Revit requires a moment after a view is activated before making model changes. You could try adding a small delay, or perhaps verifying the view is active before attempting the transaction? I'm not to familiar with the 2010 API, so not sure if this will help.

  6. #6
    I could stop if I wanted to
    Join Date
    2007-02
    Location
    Alexandra, New Zealand
    Posts
    237
    Login to Give a bone
    0

    Default Re: ViewActivated Event

    Quote Originally Posted by mdaugird View Post
    have you found a solution?
    I am hoping to use an application level macro to do a similar task.
    In the end I gave up and created a manual update command. It all changed in Revit 2011, and I have updaters doing it automatically. I haven't tried the view activated in 2011 but if it was still a problem you could subscribe to the new idling event and do your code in there.

    Just some thoughts.

    Cheers

    phillip

Similar Threads

  1. Replies: 9
    Last Post: 2014-07-07, 02:40 AM
  2. VB.Net DocumentCreated event
    By KevinBarnett in forum Dot Net API
    Replies: 0
    Last Post: 2006-01-31, 08:11 AM
  3. VB.Net savecomplete event
    By KevinBarnett in forum Dot Net API
    Replies: 0
    Last Post: 2006-01-30, 10:35 AM
  4. CommandEnded Event
    By KevinBarnett in forum Dot Net API
    Replies: 1
    Last Post: 2006-01-30, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •