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.
|
|
|
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.
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);
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.