Application Copy |
Copies an existing model to a new file. Overwriting a file of the same name is allowed.
Namespace: Autodesk.Revit.ApplicationServices
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

public void CopyModel(
ModelPath sourceModelPath,
string destFilePath,
bool overwrite
)
Parameters

Exception | Condition |
---|---|
ArgumentException | The given path sourceModelPath is a cloud path which is not supported in this method. |
ArgumentNullException | A non-optional argument was null |
CentralModelAccessDeniedException | Access to the central model was denied. A possible reason is because the model was under maintenance. |
CentralModelException | The central model is missing. -or- An internal error happened on the central model, please contact the server administrator. |
DirectoryNotFoundException | Thrown when the directory of destination file doesn't exist. |
FileArgumentAlreadyExistsException | The destination file exists and can't be overwritten. -or- destFilePath is pointing to a folder that already exists and cannot be deleted. |
FileArgumentNotFoundException | The Revit model specified by sourceModelPath doesn't exist. |
InvalidPathArgumentException | The destination file name includes one or more invalid characters. |
RevitServerCommunicationException | The server-based central model could not be accessed because of a network communication error. |
RevitServerInternalException | An internal error happened on the server, please contact the server administrator. |
