Document Publish |
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Parameters
- locationId LinkElementId
- The ElementId of the ProjectLocation in the linked document, to which the transform would be published to.

Exception | Condition |
---|---|
ArgumentException | locationId does not contain a valid linkInstanceId. -or- Only RevitLinkInstance is supported through API for publish coordinates. |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | This Document is not a project document. -or- This Document is in an edit mode. -or- Attempting to publish shared coordinates to a cloud based link which is treated as read-only. -or- Failed to publish coordinates to the specified ProjectLocation of the link instance. |
ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
ModificationOutsideTransactionException | The document has no open transaction. |

The host project's True North and shared origin are recorded in the linked project, based on the current position of the linked instance. This location is now named in both the host project and the linked project. More than one position of the link can be recorded.
When you publish shared coordinates from a host Revit project to a linked DWG, this changes the linked DWG. The origin of the host Revit project's shared coordinate system becomes the origin of a new User Coordinate System (UCS) in the DWG file. The Y axis of the new UCS corresponds to the host project's True North. You can name the UCS when you publish coordinates. It is not recommended that you change this name after publishing coordinates.
Note: Currently, only RevitLinkInstance is supported. DWG link instance, which is ImportInstance is not supported now. Passing in an locationId that points to an ImportInstance would result an ArgumentException .
