Results 1 to 3 of 3

Thread: Get Element Central model location

  1. #1
    Active Member
    Join Date
    2004-06
    Posts
    95
    Login to Give a bone
    0

    Default Get Element Central model location

    How can I get a shared parameter to read the Central Model Location of a worksharing file to display the File path of the Central Model and not the local file in a titleblock?

    Just point me in the right direction.

    Thanks.

  2. #2
    100 Club
    Join Date
    2004-09
    Posts
    104
    Login to Give a bone
    0

    Default Re: Get Element Central model location

    I have developed an addin that does this.

    1. Add a project parameter to store the Central Filename value. (Shared parameter to be able to add to the titleblock.)


    2. Subscribe to an event, as close to the expected trigger actions as possible. I use the DocumentPrinting event.


    3. Find the workshared pathname and compare to the stored Central Filename project parameter. If they don't match, update the project parameter. (If you always just change it, eventually you will have ownership issues.)

    The API was changed for 2013, so the code for finding the workshared path name varies by version.

    2012 and earlier

    string worksharedname = doc.WorksharingCentralFilename;

    2013

    string workshared_name = ModelPathUtils.ConvertModelPathToUserVisiblePath(doc.GetWorksharingCentralModelPath());

    or longer version

    ModelPath mp = doc.GetWorksharingCentralModelPath();
    string worksharedname = ModelPathUtils.ConvertModelPathToUserVisiblePath(mp);

  3. #3
    Active Member
    Join Date
    2004-06
    Posts
    95
    Login to Give a bone
    0

    Default Re: Get Element Central model location

    Thank you. I'll try it and let you know what I come up with.
    Last edited by ajtrahan; 2013-03-25 at 10:00 PM.

Similar Threads

  1. Replies: 7
    Last Post: 2014-08-15, 06:03 PM
  2. 2012: Can't edit the element. It was deleted in the Central Model.
    By Bastiat in forum Revit Architecture - General
    Replies: 2
    Last Post: 2013-03-13, 08:05 AM
  3. Can't edit the element. It was deleted in Central File
    By ededios in forum Revit - Worksharing/Worksets/Revit Server
    Replies: 15
    Last Post: 2009-03-03, 03:09 PM
  4. Can't Save to Central? Changed same element?
    By Double 'A' in forum Revit Architecture - General
    Replies: 7
    Last Post: 2008-05-07, 08:53 PM
  5. Central Server Location.
    By Paul P. in forum Revit Architecture - General
    Replies: 4
    Last Post: 2006-04-28, 02:13 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
  •