- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to use CreateNewLocal to create a local file from a central file.
Unfortunately, the results of the creation is a new central file on the new target path and not a local file.
Here is a sample of the code. Could you take a look and let me know if something is wrong.
Thanks,
ModelPath sourcePath = ModelPathUtils.ConvertUserVisiblePathToModelPath("c:\temp\Central Model.rvt");
String targetName = "c:\temp\Central Model" + "_" + uiapp.Application.Username + ".rvt";
ModelPath targetPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(targetName);
try
{
WorksharingUtils.CreateNewLocal(sourcePath, targetPath);
BasicFileInfo basicfileinfo = BasicFileInfo.Extract(targetName);
if (basicfileinfo.IsCentral)
{
TaskDialog.Show("Debug", "IsCentral");
}
if (basicfileinfo.IsLocal)
{
TaskDialog.Show("Debug", "IsLocal");
}
}
catch (Autodesk.Revit.Exceptions.CentralModelAccessDeniedException e)
{
TaskDialog.Show(EnoviaAddPanel.ErrorText, "Create = " + e.Message);
break;
}
catch (Autodesk.Revit.Exceptions.CentralModelContentionException e)
{
TaskDialog.Show(EnoviaAddPanel.ErrorText, "Create = " + e.Message);
break;
}
catch (Autodesk.Revit.Exceptions.CentralModelException e)
{
TaskDialog.Show(EnoviaAddPanel.ErrorText, "Create = " + e.Message);
break;
}
catch (Autodesk.Revit.Exceptions.FileArgumentAlreadyExistsException e)
{
TaskDialog.Show(EnoviaAddPanel.ErrorText, "Create = " + e.Message);
break;
}
catch (Autodesk.Revit.Exceptions.RevitServerCommunicationException e)
{
TaskDialog.Show(EnoviaAddPanel.ErrorText, "Create = " + e.Message);
break;
}
catch (Autodesk.Revit.Exceptions.RevitServerInternalException e)
{
TaskDialog.Show(EnoviaAddPanel.ErrorText, "Create = " + e.Message);
break;
}
Solved! Go to Solution.
Developer Advocacy and Support +