Results 1 to 5 of 5

Thread: elem.Category.Name in Linked file - Crash !

  1. #1
    Member
    Join Date
    2008-09
    Location
    Atlanta, GA
    Posts
    19
    Login to Give a bone
    0

    Default elem.Category.Name in Linked file - Crash !

    Hi All,

    I am trying to get the "elem.Category.Name" from a linked .rvt file when the program crashes with the following exception:

    "Attempt to modify the model outside of transaction."

    I am not trying to assign any value to it, just trying to get the info. In fact it crashes even if I just do:

    If NOT (elem.Category is Nothing) then
    'Get the name
    End If

    Everything works fine on the primary document (ActiveDocument).

    Any help is greatly appreciated !

    Prashant

  2. #2
    100 Club
    Join Date
    2004-02
    Location
    Brookline, MA
    Posts
    186
    Login to Give a bone
    0

    Default Re: elem.Category.Name in Linked file - Crash !

    Any time that you query or modify a model, you really need to do it inside of a Transaction within Revit.

    When you're working on the Active model, Revit makes a transaction for you automatically (for convenience) so that you don't have to do it explicitly.

    When your command starts working on other models, however - there is no "automatic" transaction.

    You have to explicitly wrap what you're doing with:

    Document.BeginTransaction()


    Document.EndTransaction()

    Then I think everything will work fine for you.

    Best Regards,
    Matt

  3. #3
    Member
    Join Date
    2008-09
    Location
    Atlanta, GA
    Posts
    19
    Login to Give a bone
    0

    Default Re: elem.Category.Name in Linked file - Crash !

    Quote Originally Posted by mmason.65315 View Post

    Document.BeginTransaction()


    Document.EndTransaction()

    Then I think everything will work fine for you.
    It really does... ! I should have listened to you earlier

    Anyways, Thanks a bunch !

    Prashant

  4. #4
    Member
    Join Date
    2008-02
    Posts
    17
    Login to Give a bone
    0

    Default Re: elem.Category.Name in Linked file - Crash !

    hey...this solved my problem too!!!!!!!!!

    woo hoo!!!!!!!!

  5. #5
    I could stop if I wanted to
    Join Date
    2006-09
    Posts
    259
    Login to Give a bone
    0

    Default Re: elem.Category.Name in Linked file - Crash !

    Hi Matt,

    Any solution for this for Revit 2012?
    I have a code that I wrote in Revit 2010 using doc.BeginTransaction() and doc.EndTransaction(). I would like to use it in Revit 2012 but can't convert it to 2012 comliant. It throws transaction error message.
    Any help would be much appreciated.
    Regards

Similar Threads

  1. 2014: Linked file - By Linked View - Underlay function seems to be rendered invalid
    By NielsenDaniel in forum Revit Architecture - General
    Replies: 0
    Last Post: 2013-10-21, 07:44 PM
  2. 2012: Making one Linked Model Category Halftone
    By cmcc in forum Revit Structure - General
    Replies: 3
    Last Post: 2011-10-25, 03:46 AM
  3. File Crash
    By STHRevit in forum Revit Architecture - General
    Replies: 0
    Last Post: 2009-01-30, 06:40 AM
  4. Multi Category Schedules & Linked Files
    By dduarte in forum Revit Architecture - General
    Replies: 0
    Last Post: 2008-10-10, 11:35 PM
  5. Linked File Crash
    By aaronrumple in forum Revit Architecture - General
    Replies: 2
    Last Post: 2004-02-27, 03:54 PM

Posting Permissions

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